summaryrefslogtreecommitdiff
path: root/smartcd.test
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-18 07:30:04 -0500
committerJeff Carr <[email protected]>2025-09-18 07:30:04 -0500
commitfec80aca170e85e9bb8c122ae2c6c2283930f252 (patch)
tree39591ce1b2b561544a31a31ba9688a386ada69cd /smartcd.test
parent1522a2fef0ed356f12a5c9cc011cdad6b4cd4a05 (diff)
rename files
Diffstat (limited to 'smartcd.test')
-rw-r--r--smartcd.test18
1 files changed, 18 insertions, 0 deletions
diff --git a/smartcd.test b/smartcd.test
new file mode 100644
index 0000000..b67a5ea
--- /dev/null
+++ b/smartcd.test
@@ -0,0 +1,18 @@
+_cd_complete()
+{
+ # sets local to this func vars
+ local cur prev all
+ cur=${COMP_WORDS[COMP_CWORD]}
+ # prev=${COMP_WORDS[COMP_CWORD-1]}
+ all=${COMP_WORDS[@]}
+
+ # this is where we generate the go-arg output
+ GOARGS=$(smartcd --auto-complete \'$cur\' $all)
+
+ # this compares the command line input from the user
+ # to whatever strings we output
+ COMPREPLY=( $(compgen -W "$GOARGS" -- $cur) ) # THIS WORKS
+ return 0
+}
+complete -F _cd_complete cd
+