On 4/17/06, ray hammond <[EMAIL PROTECTED]> wrote:
>
>
>
> I'm using Mandrake Linux 2006, when I run the help command from fish
> (v1.21.4)  I get.
>
>
>
> rhh> help
>
> /usr/share/fish/functions/help.fish (line 12): htmlview
> file:///user/share/doc/fish-1.21.4/index.html
>
>
>
>
>    ^
>
> In function 'help'
>
>             Called on standard input.
>
>
>
> On inspecting the file, I noticed that there is no check to ensure the
> 'htmlview' is installed. I have not got htmlview hence I get the error.
>

There is a check, it's a call to 'type -f'. I just managed to break
the check is all. Simply using the exit status of the 'test' or
'which' commands is not portable, I'm afraid. A fixed release will be
out in a few days. Thanks for the report.

When the check works, fish tries to fall back on a long list of
various known browsers.

>
>
> A check similar to the following would cleanup the output.
>
>
>
> If test "htmlview"
>
>  Print (_ '%s, Could not find html view.\n') help
>
> Print (_ "Please install html view to access the fish help files.\n')
>
>
>
>  return
>
> end
>
>
>
> I am not familiar with the language above (is it perl?), so my solution
> maybe flawed.

It's shellscript. () is a command substitution in fish, and '_' is a
wrapper for the gettext command, used for translation. So 'echo (_
hello)' is equivalent to 'echo hello', except the former will be
translated according to your locale.

Using '_' for translation is rather obscure, I'll admit, I chose to do
it this way because that is the standard C syntax. _ is usually
defined to be a macro function calling the gettext function, so that
writing '_("Hello")' will result in a translated version of "Hello".

--
Axel


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to