mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-27 03:13:37 +08:00
8 lines
346 B
Fish
8 lines
346 B
Fish
function __fish_complete_user_ids --description "Complete user IDs with user name as description"
|
|
if command -sq getent
|
|
getent passwd | string replace -f -r '^([[:alpha:]][^:]*):[^:]*:(\d+).*' '$2\t$1'
|
|
else if test -r /etc/passwd
|
|
string replace -f -r '^([[:alpha:]][^:]*):[^:]*:(\d+).*' '$2\t$1' < /etc/passwd
|
|
end
|
|
end
|