mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-27 19:53:36 +08:00
05b52eaa0b
chown completion chown currently uses cat /etc/group to fetch the list of group names. In Cygwin there's no /etc/group file any more (user and group names are fetched directly from the OS), so when a user tries to tab-complete the group name they get an error message:
ASchulma@LZ77E1AASCHULMA ~/d/fish> chown ASchulma🐱 /etc/group: No such file or directory
This change fixes that by using getent group (via __fish_complete_groups) by preference to get the group names, and falling back to /etc/group. This is more portable.
13 lines
947 B
Fish
13 lines
947 B
Fish
complete -c chown -s c -l changes --description "Output diagnostic for changed files"
|
|
complete -c chown -l dereference --description "Dereference symbolic links"
|
|
complete -c chown -s h -l no-dereference --description "Do not dereference symbolic links"
|
|
complete -c chown -l from --description "Change from owner/group"
|
|
complete -c chown -s f -l silent --description "Suppress errors"
|
|
complete -c chown -l reference --description "Use same owner/group as file" -r
|
|
complete -c chown -s R -l recursive --description "Operate recursively"
|
|
complete -c chown -s v -l verbose --description "Output diagnostic for every file"
|
|
complete -c chown -s h -l help --description "Display help and exit"
|
|
complete -c chown -l version --description "Display version and exit"
|
|
complete -c chown --description "Username" -a "(__fish_print_users):"
|
|
complete -c chown --description "Username" -a "(echo (commandline -ct)| __fish_sgrep -o '.*:')(__fish_complete_groups)"
|