369980bf93
Also move indentation settings to end of files and expand *Emacs ones to local variables block to avoid overflowing 80 char lines.
51 lines
1.0 KiB
Bash
51 lines
1.0 KiB
Bash
# bash completion for mc
|
|
|
|
have mc &&
|
|
_mc()
|
|
{
|
|
local cur prev split=false
|
|
|
|
COMPREPLY=()
|
|
cur=`_get_cword`
|
|
prev=${COMP_WORDS[COMP_CWORD-1]}
|
|
|
|
_split_longopt && split=true
|
|
|
|
case "$prev" in
|
|
-e|--edit|-v|--view|-l|--ftplog|-P|--printwd)
|
|
_filedir
|
|
return 0
|
|
;;
|
|
-C|--colors|-D|--debuglevel)
|
|
# argument required but no completions available
|
|
return 0
|
|
;;
|
|
-h|--help|-V|--version)
|
|
# all other arguments are noop with these
|
|
return 0
|
|
;;
|
|
esac
|
|
|
|
$split && return 0
|
|
|
|
if [[ "$cur" == -* ]]; then
|
|
COMPREPLY=( $( compgen -W '-a --stickchars -b --nocolor -c \
|
|
--color -C --colors -d --nomouse -e --edit -f \
|
|
--datadir -k --resetsoft -l --ftplog -P --printwd \
|
|
-s --slow -t --termcap -u --nosubshell -U --subshell \
|
|
-v --view -V --version -x --xterm -D --debuglevel -h \
|
|
--help' -- "$cur" ) )
|
|
else
|
|
_filedir -d
|
|
fi
|
|
} &&
|
|
complete -F _mc $filenames mc
|
|
|
|
# Local variables:
|
|
# mode: shell-script
|
|
# sh-basic-offset: 8
|
|
# sh-indent-comment: t
|
|
# indent-tabs-mode: t
|
|
# End:
|
|
# ex: ts=8 sw=8 noet filetype=sh
|