update chown completions

Add completions that are correct on darwin and probably bsd.
Add missing -H, -L, -P completions to GNU chown.
Remove errant GNU completion claiming -h is short for --help.
This commit is contained in:
Aaron Gyes 2022-01-31 21:54:07 -08:00
parent 56a4920856
commit 9ec359d133

View file

@ -1,12 +1,25 @@
complete -c chown -s c -l changes -d "Output diagnostic for changed files"
complete -c chown -l dereference -d "Dereference symbolic links"
complete -c chown -s h -l no-dereference -d "Do not dereference symbolic links"
complete -c chown -l from -d "Change from owner/group"
complete -c chown -s f -l silent -d "Suppress errors"
complete -c chown -l reference -d "Use same owner/group as file" -r
complete -c chown -s R -l recursive -d "Operate recursively"
complete -c chown -s v -l verbose -d "Output diagnostic for every file"
complete -c chown -s h -l help -d "Display help and exit"
complete -c chown -l version -d "Display version and exit"
complete -c chown -d Username -a "(__fish_print_users):"
complete -c chown -d Username -a "(string match -r -- '.*:' (commandline -ct))(__fish_complete_groups)"
if chown --version &>/dev/null # gee, and you is not eunichs
complete chown -s c -l changes -d "Output diagnostic for changed files"
complete chown -l dereference -d "Dereference symbolic links"
complete chown -s h -l no-dereference -d "Do not dereference symbolic links"
complete chown -l from -d "Change from owner/group"
complete chown -s f -l silent -d "Suppress errors"
complete chown -l reference -d "Use same owner/group as file" -r
complete chown -s R -l recursive -d "Operate recursively"
complete chown -s v -l verbose -d "Output diagnostic for every file"
complete chown -l help -d "Display help and exit"
complete chown -l version -d "Display version and exit"
else
complete chown -s R -d 'Operate recursively'
complete chown -s f -d "Suppress errors"
complete chown -s h -d "Do not dereference symbolic links"
complete chown -s n -d "uid/gid is numeric; avoid lookup"
complete chown -s v -d "Output filenames as modified"
complete chown -s x -d "Don't traverse fs mount points"
end
complete chown -s H -d "Follow given symlinks with -R"
complete chown -s L -d "Follow all symlinks with -R"
complete chown -s P -d "Follow no symlinks with -R"
complete chown -d User -a "(__fish_print_users):"
complete chown -d User -a "(string match -r -- '.*:' (commandline -ct))(__fish_complete_groups)"