aboutsummaryrefslogtreecommitdiffstats
path: root/commands/util.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/util.go')
-rw-r--r--commands/util.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/commands/util.go b/commands/util.go
index e7940017..af8d3dfa 100644
--- a/commands/util.go
+++ b/commands/util.go
@@ -71,7 +71,7 @@ func QuickTerm(args []string, stdin io.Reader) (*app.Terminal, error) {
}
// CompletePath provides filesystem completions given a starting path.
-func CompletePath(path string) []string {
+func CompletePath(path string, onlyDirs bool) []string {
if path == ".." || strings.HasSuffix(path, "/..") {
return []string{path + "/"}
}
@@ -93,6 +93,8 @@ func CompletePath(path string) []string {
for _, m := range matches {
if isDir(m) {
m += "/"
+ } else if onlyDirs {
+ continue
}
if strings.HasPrefix(filepath.Base(m), ".") && !includeHidden {
continue