26 lines
880 B
Bash
26 lines
880 B
Bash
# fac completion -*- shell-script -*-
|
|
|
|
_fac() {
|
|
local words cword cmd cur
|
|
_init_completion -s || return
|
|
|
|
for ((cmd = 1; cmd <= cword; cmd++)); do
|
|
local flag="${words[cmd]}"
|
|
|
|
if [[ $flag == -* ]]; then
|
|
if [ "$flag" = '-format' ]; then
|
|
COMPREPLY=($(compgen -W "x86-64-gnulinux x86-64-freebsd" -- "$cur"))
|
|
else
|
|
case "$flag" in
|
|
-input | -output | -rstack-size | -flags) ;;
|
|
|
|
*) COMPREPLY=($(compgen -W "-no-anotate -asm-flags -help \
|
|
-no-compile -stdout -no-logging -dbg -run -list-formats -format -input
|
|
-rstack-size -flags -no-ansi -no-dce -no-stats -no-tc" -- "$cur")) ;;
|
|
esac
|
|
fi
|
|
fi
|
|
done
|
|
} && complete -F _fac -o bashdefault -o default fac
|
|
|
|
# ex: filetype=sh
|