On 4/4/07, flixil <[EMAIL PROTECTED]> wrote: > I have fish, version 1.22.1 > > I tried to use the alias function defined in /usr/share/fish/functions/ > with more than 2 params to understand alias as an example of function > but it doesn't print anything. > > It is supose to print: > Expected one or two arguments, got %d > > That's exactly what i did and how alias.fish is defined. > > Thanks for reading, i liked fish a lot :) > > [EMAIL PROTECTED] fish > Welcome to fish, the friendly interactive shell > Type help for instructions on how to use fish > [EMAIL PROTECTED] ~> alias p='echo hello world' > [EMAIL PROTECTED] ~> p > hello world > [EMAIL PROTECTED] ~> alias 1 2 3 4 5 > [EMAIL PROTECTED] ~> cat /usr/share/fish/functions/alias.fish > > function alias -d (_ "Legacy function for creating shellscript functions > using an alias-like syntax") > set -l name > set -l body > switch (count $argv) > > case 1 > set -l tmp (echo $argv|sed -e "s/\([^=]\)=/\1\n/") > set name $tmp[1] > set body $tmp[2] > > case 2 > set name $argv[1] > set body $argv[2] > > case \* > printf ( _ "%s: Expected one or two arguments, got %d") > alias (count $argv) > return 1 > end > > eval "function $name; $body \$argv; end" > end
Hi, and thanks for the report. The actual problem is quite subtle - the error message is missing a newline at the end, and is then overwritten by the prompt. The wierd part is that fish used to have the problem of overwriting output with no trailing newline, but this was fixed some time ago. I guess the problem has resurfaced. I've added the missing newline and will investigate the prompt overwrite behaviour. -- Axel ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Fish-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/fish-users
