File: arcanist.bash-completion

package info (click to toggle)
phabricator 0~git20190207-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 71,728 kB
  • sloc: php: 552,244; sql: 16,997; ansic: 3,619; yacc: 2,503; sh: 754; xml: 519; lex: 488; cpp: 221; python: 186; makefile: 177; sed: 66
file content (26 lines) | stat: -rw-r--r-- 502 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
if [[ -n ${ZSH_VERSION-} ]]; then
  autoload -U +X bashcompinit && bashcompinit
fi

_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