I've attached my shot at a more robust help function. The robustness is in doing a better job picking which browser to use especially from inside a virtual console. I also added some more comments and a little more user feedback. I didn't make any changes to the code that figures out what url or man page to display.
First, I expanded the lists of text and graphics browsers to include all the newer ones I know about. Notable additions are chromium and links2. The second problem I addressed was that the automatic choice of browser was overridden by the $BROWSER variable. So if $BROWSER was set to "firefox" then the help command would not work in the virtual consoles. This was solved by adding $BROWSER to the lists of browsers to check. That way, it is only used if it exists, there is a fallback if it doesn't exist, and we try not to let a graphical browser get selected when we are not in X windows (if it does then, again, no help gets displayed). I let users select a non-graphical browser for displaying help while in X but in that case we don't launch the browser in the background (which once again would prevent help from being displayed). There is probably room for further improvements, such as an even more informative message if we can't find a browser and letting users specify a $TEXTBROWSER separate from (and perhaps in addition to) $BROWSER. I think even as-is, this is a significant improvement over the current help.fish. I hope my code is clear. Peace, James
help.fish
Description: Binary data
------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users