diff options
| author | Eyal Posener <[email protected]> | 2017-05-18 23:34:43 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-05-18 23:34:43 +0300 |
| commit | dce08717c1081a4d35028ff7c2bc04d0b6b49d60 (patch) | |
| tree | 17357f14eadb4654287eb664dfbe02914167f4db /args.go | |
| parent | 659bd9e3d5a0113fb862bcbd06a983b0e74e8df7 (diff) | |
| parent | 61d9904ba1f47bf5bbd3497ac0c9f5787adb8633 (diff) | |
Merge pull request #27 from posener/prefixes
Fix './' prefix for file completion
Diffstat (limited to 'args.go')
| -rw-r--r-- | args.go | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -28,19 +28,13 @@ type Args struct { // in case that it is not, we fall back to the current directory. func (a Args) Directory() string { if info, err := os.Stat(a.Last); err == nil && info.IsDir() { - if !filepath.IsAbs(a.Last) { - return relativePath(a.Last) - } - return a.Last + return fixPathForm(a.Last, a.Last) } dir := filepath.Dir(a.Last) if info, err := os.Stat(dir); err != nil || !info.IsDir() { return "./" } - if !filepath.IsAbs(dir) { - dir = relativePath(dir) - } - return dir + return fixPathForm(a.Last, dir) } func newArgs(line []string) Args { |
