fish-shell/share/functions/__fish_complete_group_ids.fish
Fabian Homborg 9367d4ff71 Reindent functions to remove useless quotes
This does not include checks/function.fish because that currently
includes a "; end" in a message that indent would remove, breaking the test.
2020-03-09 19:46:43 +01:00

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