dogfood string split -f

This commit is contained in:
Jason Nader
2020-04-18 14:58:07 +09:00
committed by Johannes Altmanninger
parent 3bb86d3a61
commit f66285d7a1
5 changed files with 15 additions and 13 deletions

View File

@@ -1,8 +1,12 @@
function __fish_complete_groups --description "Print a list of local groups, with group members as the description"
if command -sq getent
getent group | cut -d ':' -f 1,4 | string replace : \t
getent group | while read -l line
string split -f 1,4 : -- $line | string join \t
end
else
cut -d ':' -f 1,4 /etc/group | string replace : \t
while read -l line
string split -f 1,4 : -- $line | string join \t
end </etc/group
end
end