Skip to content

Commit

Permalink
Cleaner way to return to normal
Browse files Browse the repository at this point in the history
  • Loading branch information
wadewegner committed Jan 18, 2018
1 parent b8a782b commit 59b0eba
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions sfdx.bash
Original file line number Diff line number Diff line change
Expand Up @@ -124,21 +124,31 @@ _sfdx()

case "$prev" in
sfdx)

COMPREPLY=( $(compgen -W "${words[*]}" -- $cur))
__ltrim_colon_completions "$cur"
;;
*)
COMPREPLY=($(compgen -f -- "${COMP_WORDS[${COMP_CWORD}]}" ))

for ((ff=0; ff<${#COMPREPLY[@]}; ff++)); do
test -d "${COMPREPLY[$ff]}" && COMPREPLY[$ff]="${COMPREPLY[$ff]}/"
test -f "${COMPREPLY[$ff]}" && COMPREPLY[$ff]="${COMPREPLY[$ff]} "
done
force:org:create)

local -a args=(
-s \
-f \
)

COMPREPLY=( $(compgen -W "${args[*]}" -- $cur))
__ltrim_colon_completions "$cur"
;;

*)
# return to normal completion
COMPREPLY=()

;;

esac

return 0
}

complete -o bashdefault -o nospace -F _sfdx sfdx
complete -o default -F _sfdx sfdx

0 comments on commit 59b0eba

Please sign in to comment.