mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
bash_completion: update for new help output format
This commit is contained in:
parent
9e5ece5a78
commit
a6928b8448
@ -73,11 +73,8 @@ _hg()
|
||||
done
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
opts="$(hg -v help | sed -e '1,/^global options/d; /^ -/!d')"
|
||||
|
||||
if [ -n "$cmd" ]; then
|
||||
opts="$opts $(hg help "$cmd" | sed -e '/^ -/!d; s/ [^-][^ ]*//')"
|
||||
fi
|
||||
# this assumes that there are no commands with spaces in the name
|
||||
opts=$(hg -v help $cmd | sed -e '/^ *-/!d; s/ [^- ].*//')
|
||||
|
||||
COMPREPLY=( ${COMPREPLY[@]:-} $(compgen -W "$opts" -- "$cur") )
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user