From 36691df6fe4667645b71b550ce5eea90762ac23a Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Fri, 8 Apr 2016 10:46:51 +0800 Subject: Stringify many completions and functions, with --invert stringification. I believe apm must have been buggy - example output that I found online showed `tr` was mangling paths with spaces in it. Should be fixed. Also, use dscl on OS X in __fish_complete_users.fish like __fish_print_users.fish already does. --- share/functions/__fish_complete_users.fish | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'share/functions/__fish_complete_users.fish') diff --git a/share/functions/__fish_complete_users.fish b/share/functions/__fish_complete_users.fish index 91c254da..199231be 100644 --- a/share/functions/__fish_complete_users.fish +++ b/share/functions/__fish_complete_users.fish @@ -1,8 +1,10 @@ function __fish_complete_users --description "Print a list of local users, with the real user name as a description" if test -x /usr/bin/getent - getent passwd | cut -d : -f 1,5 | sed 's/:/\t/' + 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 - __fish_sgrep -ve '^#' /etc/passwd | cut -d : -f 1,5 | sed 's/:/\t/' + string match -v -r '^\s*#' < /etc/passwd | cut -d : -f 1,5 | string replace ':' \t end end -- cgit v1.2.3