From a4758595aa43b031174043d6115a26f2cd4c962d Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 12 Oct 2025 00:10:48 -0500 Subject: thoughts --- smartcd.test | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 smartcd.test (limited to 'smartcd.test') diff --git a/smartcd.test b/smartcd.test new file mode 100644 index 0000000..d476814 --- /dev/null +++ b/smartcd.test @@ -0,0 +1,20 @@ +# could work like 'z' ? + +_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 + -- cgit v1.2.3