rename files

This commit is contained in:
Jeff Carr 2025-09-18 07:30:04 -05:00
parent 1522a2fef0
commit fec80aca17
4 changed files with 23 additions and 0 deletions

View File

@ -218,6 +218,7 @@ func parseArgv(argname string) *Auto {
func Bash2(argname string, autocomplete func(*Auto)) {
newauto := parseArgv(argname)
if newauto.SetupAuto {
// --bash was passed. try to configure bash-completion
doBash2(argname)
os.Exit(0)
}
@ -230,6 +231,10 @@ func Bash2(argname string, autocomplete func(*Auto)) {
if len(os.Args) > 1 && os.Args[1] == "--auto-complete" {
doHandlePB(newauto)
autocomplete(newauto)
if newauto.Debug {
// check here to see if there was any completion text sent
// if not, send "reset bash newline\n" to cause bash to redraw PS1 for the user
}
os.Exit(0)
}

18
smartcd.test Normal file
View File

@ -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