mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-06 00:31:13 -03:00
dogfood string split -f
This commit is contained in:
committed by
Johannes Altmanninger
parent
3bb86d3a61
commit
f66285d7a1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user