Hi list.
I have just started with using fish and I love it already. Great for a
casual shell user like me to have completions for just about everything. I
found a few minor bugs in the standard function library though, most of
which have already been mentioned on the list. Here are my first patches,
perhaps they will be useful to someone:

This fixes the problem with completions on OS X where the passwd file starts
with a bunch of comment lines.

diff /opt/local/share/fish/functions/__fish_complete_users.fish
/Users/sven/Sources/fish/share/functions/__fish_complete_users.fish
2c3
< cat /etc/passwd | grep -ve '^#' | sed -e
's/^\([^:]*\):[^:]*:[^:]*:[^:]*:\([^:]*\):.*$/\1'\t'\2/' ^/dev/null
---
> cat /etc/passwd | sed -e
"s/^\([^:]*\):[^:]*:[^:]*:[^:]*:\([^:]*\):.*/\1\t\2/"

In case $previous is empty.

diff /opt/local/share/fish/functions/cd.fish
/Users/sven/Sources/fish/share/functions/cd.fish
28c28
< if test $cd_status = 0 -a "$PWD" != "$previous"
---
> if test $cd_status = 0 -a $PWD != $previous

-1 is not a flag.

diff /opt/local/share/fish/functions/dirh.fish
/Users/sven/Sources/fish/share/functions/dirh.fish
29c29
< for i in (seq (echo (count $dirnext)) - 1 1)
---
> for i in (seq (echo (count $dirnext)) -1 1)

Directory after flags.

diff /opt/local/share/fish/functions/ls.fish
/Users/sven/Sources/fish/share/functions/ls.fish
23c23
< if command ls -G / 1>/dev/null 2>/dev/null
---
> if command ls / -G 1>/dev/null 2>/dev/null

Formatting quirk. Still is seems unnecessary to pass the function name as a
parameter and also have it directly in the formatting string.

diff /opt/local/share/fish/functions/vared.fish
/Users/sven/Sources/fish/share/functions/vared.fish
42c42
< printf (_ '%s: %s is an array variable. Use %svared%s %s[n] to edit the
n:th element of %s\n') vared $argv (set_color $fish_color_command)
(set_color $fish_color_normal) $argv $argv
---
> printf (_ '%s: %s is an array variable. Use %svared%s %s[n] to edit the
n:th element of %s\n') $argv (set_color $fish_color_command) (set_color
$fish_color_normal) vared $argv $argv


-- 
Sven Axelsson
++++++++++[>++++++++++>+++++++++++>++++++++++>++++++
>++++<<<<<-]>++++.+.++++.>+++++.>+.<<-.>>+.>++++.<<.
+++.>-.<<++.>>----.<++.>>>++++++.<<<<.>>++++.<----.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to