2007-09-21 20:52:12 +00:00
|
|
|
|
|
|
|
function __fish_complete_users --description "Print a list of local users, with the real user name as a description"
|
2012-11-22 09:07:19 +00:00
|
|
|
if test -x /usr/bin/getent
|
2016-04-08 02:46:51 +00: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 09:07:19 +00:00
|
|
|
else
|
2016-04-08 02:46:51 +00:00
|
|
|
string match -v -r '^\s*#' < /etc/passwd | cut -d : -f 1,5 | string replace ':' \t
|
2012-11-22 09:07:19 +00:00
|
|
|
end
|
2007-09-21 20:52:12 +00:00
|
|
|
end
|