mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-26 00:32:41 +01:00
2a78b2bffa
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
22 lines
418 B
Text
22 lines
418 B
Text
_arc ()
|
|
{
|
|
CUR="${COMP_WORDS[COMP_CWORD]}"
|
|
COMPREPLY=()
|
|
OPTS=$(echo | arc shell-complete --current ${COMP_CWORD} -- ${COMP_WORDS[@]})
|
|
|
|
if [ $? -ne 0 ]; then
|
|
return $?
|
|
fi
|
|
|
|
if [ "$OPTS" = "FILE" ]; then
|
|
COMPREPLY=( $(compgen -f -- ${CUR}) )
|
|
return 0
|
|
fi
|
|
|
|
if [ "$OPTS" = "ARGUMENT" ]; then
|
|
return 0
|
|
fi
|
|
|
|
COMPREPLY=( $(compgen -W "${OPTS}" -- ${CUR}) )
|
|
}
|
|
complete -F _arc -o filenames arc
|