Skip to content

Commit

Permalink
Aucompletion guards for /etc/passwd #3980
Browse files Browse the repository at this point in the history
  • Loading branch information
christianrondeau authored and Kurtis Rader committed Apr 24, 2017
1 parent 30e0238 commit bea0b17
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion share/functions/__fish_complete_users.fish
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function __fish_complete_users --description "Print a list of local users, with
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
else
else if test -e /etc/passwd
string match -v -r '^\s*#' </etc/passwd | cut -d : -f 1,5 | string replace ':' \t
end
end
2 changes: 1 addition & 1 deletion share/functions/__fish_print_users.fish
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function __fish_print_users --description "Print a list of local users"
getent passwd | cut -d : -f 1
else if test -x /usr/bin/dscl # OS X support
dscl . -list /Users | string match -r -v '^_'
else
else if test -e /etc/passwd
string match -v -r '^\w*#' </etc/passwd | cut -d : -f 1
end
end
Expand Down

0 comments on commit bea0b17

Please sign in to comment.