2007-09-22 04:52:12 +08:00
|
|
|
|
|
|
|
function __fish_complete_users --description "Print a list of local users, with the real user name as a description"
|
2012-11-22 17:07:19 +08:00
|
|
|
if test -x /usr/bin/getent
|
2016-04-08 10:46:51 +08:00
|
|
|
getent passwd | cut -d : -f 1,5 | string replace -r ':' \t
|
|
|
|
else if test -x /usr/bin/dscl
|
|
|
|
dscl . -list /Users RealName | string match -r -v '^_' | string replace -r ' {2,}' \t
|
2012-11-22 17:07:19 +08:00
|
|
|
else
|
2016-04-08 10:46:51 +08:00
|
|
|
string match -v -r '^\s*#' < /etc/passwd | cut -d : -f 1,5 | string replace ':' \t
|
2012-11-22 17:07:19 +08:00
|
|
|
end
|
2007-09-22 04:52:12 +08:00
|
|
|
end
|