mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 15:37:59 +08:00
8 lines
346 B
Fish
8 lines
346 B
Fish
function __fish_complete_group_ids --description "Complete group IDs with group name as description"
|
|
if command -sq getent
|
|
getent group | string replace -f -r '^([[:alpha:]][^:]*):[^:]*:(\d+).*' '$2\t$1'
|
|
else if test -r /etc/group
|
|
string replace -f -r '^([[:alpha:]][^:]*):[^:]*:(\d+).*' '$2\t$1' < /etc/group
|
|
end
|
|
end
|