fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
49c5f9647
master
1# Completions for passwd 2 3function __fish_passwd_darwin_infosystem 4echo -e"PAM\tPluggable Authentication Module" 5echo -e"opendirectory\tOpen Directory-compatible system" 6echo -e"file\tLocal flat-file" 7echo -e"nis\tRemote NIS server" 8end 9 10if passwd --help> /dev/null2>&1 11complete -c passwd -n'__fish_contains_opt -s S status' -s a -l all -f -d"Display password state for all users" 12complete -c passwd -s d -l delete -f -d"Delete user password" 13complete -c passwd -s e -l expire -f -d"Immediately obsolete user password" 14complete -c passwd -s h -l help -f -d"Display help and exit" 15complete -c passwd -s i -l inactive -x -d"Schedule account inactivation after password expiration" 16complete -c passwd -s k -l keep-tokens -f -d"Wait tokens expiration before changing password" 17complete -c passwd -s l -l lock -f -d"Lock password" 18complete -c passwd -s n -l mindays -x -d"Define minimum delay between password changes" 19complete -c passwd -s q -l quiet -f -d"Be quiet" 20complete -c passwd -s r -l repository -r -d"Update given repository" 21complete -c passwd -s R -l root -r -d"Use given directory as working directory" 22complete -c passwd -s S -l status -f -d"Display account status" 23complete -c passwd -s u -l unlock -f -d"Unlock password" 24complete -c passwd -s w -l warndays -x -d"Define warning period before mandatory password change" 25complete -c passwd -s w -l warndays -x -d"Define maximum period of password validity" 26complete -c passwd -n'__fish_not_contain_opt -s A all' -f -a'(__fish_complete_users)' -d"Account to be altered" 27else # Not Linux, so let's see what it is, with the ugly uname 28set -l os_type( uname ) 29switch $os_type 30case Darwin# macOS family 31complete -c passwd -f -a'(__fish_complete_users)' -d"Account to be altered" 32complete -c passwd -x -s i -a'(__fish_passwd_darwin_infosystem)' -d"Directory system to apply the update to" 33complete -c passwd -x -s l -d"Location to be updated on chosen directory system" 34complete -c passwd -x -s u -d"User name to use on chosen directory system" 35case FreeBSD 36complete -c passwd -f -s l -d"Update locally, not in Kerberos" 37complete -c passwd -f -a'(__fish_complete_users)' -d"Account to be altered" 38end 39# This is common to Darwin, FreeBSD and OpenBSD, and is even the only possible completion under OpenBSD 40# This is separated from Linux completions, because the Linux one is useless with -A / --all, 41# whereas -A / --all does not exist under *BSD 42complete -c passwd -f -a'(__fish_complete_users)' -d"Account to be altered" 43end