mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 08:41:13 +08:00
Complete IDs for unix users and groups that start with _
This commit is contained in:
parent
8320467bb0
commit
685b668958
|
@ -1,7 +1,7 @@
|
||||||
function __fish_complete_group_ids --description "Complete group IDs with group name as description"
|
function __fish_complete_group_ids --description "Complete group IDs with group name as description"
|
||||||
if command -sq getent
|
if command -sq getent
|
||||||
getent group | string replace -f -r '^([[:alpha:]][^:]*):[^:]*:(\d+).*' '$2\t$1'
|
getent group | string replace -f -r '^([[:alpha:]_][^:]*):[^:]*:(\d+).*' '$2\t$1'
|
||||||
else if test -r /etc/group
|
else if test -r /etc/group
|
||||||
string replace -f -r '^([[:alpha:]][^:]*):[^:]*:(\d+).*' '$2\t$1' </etc/group
|
string replace -f -r '^([[:alpha:]_][^:]*):[^:]*:(\d+).*' '$2\t$1' </etc/group
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
function __fish_complete_user_ids --description "Complete user IDs with user name as description"
|
function __fish_complete_user_ids --description "Complete user IDs with user name as description"
|
||||||
if command -sq getent
|
if command -sq getent
|
||||||
getent passwd | string replace -f -r '^([[:alpha:]][^:]*):[^:]*:(\d+).*' '$2\t$1'
|
getent passwd | string replace -f -r '^([[:alpha:]_][^:]*):[^:]*:(\d+).*' '$2\t$1'
|
||||||
else if test -r /etc/passwd
|
else if test -r /etc/passwd
|
||||||
string replace -f -r '^([[:alpha:]][^:]*):[^:]*:(\d+).*' '$2\t$1' </etc/passwd
|
string replace -f -r '^([[:alpha:]_][^:]*):[^:]*:(\d+).*' '$2\t$1' </etc/passwd
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user