2006-01-13 14:05:36 +00:00
|
|
|
#
|
|
|
|
# Completions for the chsh command
|
|
|
|
#
|
|
|
|
|
2012-12-01 22:12:11 +00:00
|
|
|
# This grep tries to match nonempty lines that do not start with hash
|
2015-10-21 10:38:45 +00:00
|
|
|
complete -c chsh -s s -l shell -x -a "(string match -r '^[^#].*' < /etc/shells)" -d "Specify your login shell"
|
|
|
|
complete -c chsh -s u -l help -d "Display help and exit "
|
2006-01-13 14:05:36 +00:00
|
|
|
complete -c chsh -s v -l version -d "Display version and exit"
|
|
|
|
complete -x -c chsh -a "(__fish_complete_users)"
|
|
|
|
|
2017-10-25 18:54:03 +00:00
|
|
|
# util-linux's chsh also has a "-l"/"--list-shells" option.
|
|
|
|
# While both FreeBSD and macOS also have "-l", it means something different and probably uninteresting.
|
2018-04-01 20:42:38 +00:00
|
|
|
if set -l chshversion (chsh --version 2>/dev/null); and string match -qr '.*util-linux.*' -- $chshversion
|
2017-10-25 18:54:03 +00:00
|
|
|
complete -f -c chsh -s l -l list-shells -d "List available shells and exit"
|
|
|
|
end
|