rename files
This commit is contained in:
parent
1522a2fef0
commit
fec80aca17
|
@ -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)
|
||||
}
|
||||
|
|
@ -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
|
||||
|
Loading…
Reference in New Issue