error context for completions
This commit is contained in:
parent
2f224240bf
commit
37a547fd43
8
comp.go
8
comp.go
@ -68,14 +68,14 @@ func matchExec(s string) string {
|
|||||||
|
|
||||||
fi, err := ioutil.ReadDir(p)
|
fi, err := ioutil.ReadDir(p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Print(err)
|
log.Printf("reading path: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, f := range fi {
|
for _, f := range fi {
|
||||||
if strings.HasPrefix(f.Name(), s) {
|
if strings.HasPrefix(f.Name(), s) {
|
||||||
f, err = os.Stat(path.Join(p, f.Name()))
|
f, err = os.Stat(path.Join(p, f.Name()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Print(err)
|
log.Printf("getting file information: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !f.Mode().IsRegular() || f.Mode()&0111 == 0 {
|
if !f.Mode().IsRegular() || f.Mode()&0111 == 0 {
|
||||||
@ -102,12 +102,12 @@ func matchFile(s string) string {
|
|||||||
|
|
||||||
wd, err := os.Getwd()
|
wd, err := os.Getwd()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Print(err)
|
log.Printf("getting current directory: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fi, err := ioutil.ReadDir(wd)
|
fi, err := ioutil.ReadDir(wd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Print(err)
|
log.Printf("reading directory: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, f := range fi {
|
for _, f := range fi {
|
||||||
|
Loading…
Reference in New Issue
Block a user