acpi,chpasswd,dmesg,gkrellm,groupmems,hwclock,lastlog,pwd,vipw: Complete options even without "-" given.

This commit is contained in:
Ville Skyttä 2013-02-02 21:01:18 +02:00
parent 250d5eb932
commit 452e938766
9 changed files with 17 additions and 38 deletions

View File

@ -15,8 +15,7 @@ _acpi()
;;
esac
[[ $cur == -* ]] && \
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
} &&
complete -F _acpi acpi

View File

@ -18,11 +18,8 @@ _chpasswd()
$split && return 0
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
[[ $COMPREPLY == *= ]] && compopt -o nospace
return 0
fi
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _chpasswd chpasswd

View File

@ -22,12 +22,9 @@ _dmesg()
;;
esac
if [[ $cur == -* ]]; then
local opts=$( _parse_help "$1" )
[[ $opts ]] || opts=$( _parse_usage "$1" )
COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) )
return
fi
local opts=$( _parse_help "$1" )
[[ $opts ]] || opts=$( _parse_usage "$1" )
COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) )
} &&
complete -F _dmesg dmesg

View File

@ -32,10 +32,7 @@ _gkrellm()
;;
esac
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
fi
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
} &&
complete -F _gkrellm gkrellm gkrellm2

View File

@ -20,10 +20,7 @@ _groupmems()
;;
esac
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
return 0
fi
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
} &&
complete -F _groupmems groupmems

View File

@ -11,12 +11,12 @@ _hwclock()
;;
-f|--rtc|--adjfile)
_filedir
return
;;
esac
[[ $cur == -* ]] && \
COMPREPLY=( $( PATH="$PATH:/sbin"
compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
COMPREPLY=(
$( PATH="$PATH:/sbin" compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
} &&
complete -F _hwclock hwclock

View File

@ -17,11 +17,8 @@ _lastlog()
$split && return 0
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
[[ $COMPREPLY == *= ]] && compopt -o nospace
return 0
fi
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _lastlog lastlog

View File

@ -11,11 +11,9 @@ _pwd()
;;
esac
if [[ $cur == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
[[ $COMPREPLY ]] || \
COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
fi
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
[[ $COMPREPLY ]] || \
COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
} &&
complete -F _pwd pwd

View File

@ -15,10 +15,7 @@ _vipw()
;;
esac
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
return 0
fi
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
} &&
complete -F _vipw vipw vigr