2
0
Fork 0
mirror of https://github.com/fish-shell/fish-shell synced 2025-02-24 11:27:41 +00:00
fish-shell/share/functions/__fish_complete_group_ids.fish
2020-03-10 20:56:45 +01:00

7 lines
347 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