mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-09 16:32:39 +01:00
bash completion: work around PHP CLI readline in command substitution
Summary: (At least my build of) PHP tries to do readline magic on the terminal when invoked from the shell, even inside bash's command substitution operator. Work around it by piping the output of ##echo## to ##php##, so the input isn't a terminal. Test Plan: ##bash$ arc li<TAB>## now gives me possible completions rather than breaking and inserting a literal tab Reviewers: epriestley Reviewed By: epriestley CC: aran, epriestley Differential Revision: 1096
This commit is contained in:
parent
8a7e0b7783
commit
2a78b2bffa
1 changed files with 6 additions and 8 deletions
|
@ -1,9 +1,8 @@
|
||||||
_arc()
|
_arc ()
|
||||||
{
|
{
|
||||||
|
|
||||||
CUR="${COMP_WORDS[COMP_CWORD]}"
|
CUR="${COMP_WORDS[COMP_CWORD]}"
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
OPTS=$(arc shell-complete --current ${COMP_CWORD} -- ${COMP_WORDS[@]})
|
OPTS=$(echo | arc shell-complete --current ${COMP_CWORD} -- ${COMP_WORDS[@]})
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
return $?
|
return $?
|
||||||
|
@ -19,6 +18,5 @@ _arc()
|
||||||
fi
|
fi
|
||||||
|
|
||||||
COMPREPLY=( $(compgen -W "${OPTS}" -- ${CUR}) )
|
COMPREPLY=( $(compgen -W "${OPTS}" -- ${CUR}) )
|
||||||
|
|
||||||
}
|
}
|
||||||
complete -F _arc -o filenames arc
|
complete -F _arc -o filenames arc
|
||||||
|
|
Loading…
Reference in a new issue