I tried to incorporate all the changes that were discussed yesterday. I've attached version 1.04 (after sending it through fish_indent).
o Changed comments on confusing browser selection code.
o Added warning messages if $BROWSER or $CONSOLE_BROWSER browser
failed (because it was not found or not executable).
o Moved selection of topic ahead of selection of browser. I don't
know if this is better or not.
o used:
case (ls $__fish_datadir/man | sed '/\.1$/ s/\.1$//')
for list of commands we have help on. Perhaps we should keep
the old case statement that reads the HTML as well, just in case
the man pages and the HTML get out of sync. Thoughts?
o used:
if man -w $fish_help_item | grep -q "^/"
to see if a man page was available instead of "type ..."
o System man pages always get printed whether we can find a browser
or not.
o If a man page and an HTML page cover the same topic, we display
the HTML if a browser is available, otherwise, we fall back to the
man page. This can be over-ridden with the -m --man-page flag.
o Changed the no-browser flag abbreviations. They are now:
-nb --nb --no-b ... --no-browser
o This made room for a --no-color option to turn off colorization:
-nc --nc --no-c ... --no-color
o Changed the name of $fish_quiet_help to $fish_help_quiet
The current set of flags are:
-h --help Show help on help
-m --man-page If possible, show man page, not HTML
-nb --no-browser Pretend we could not find browser
-nc --no-color Turn off colorization
-q --quiet Turn off informational messages
-s --shutup Change default mode to quiet
-t --text Don't use a graphical browser
-v --verbose Change default mode back to verbose
I think we need to keep at least --help and --text. The
--no-browser flag should go since it is really only useful for
testing. The --no-color and --man-page flags might be useful to
someone someday. That leaves the three flags dealing with
verbosity: --quiet, --verbose, and --shutup. Perhaps we could
get rid of --verbose and --shutup but keep --quiet and keep the
$fish_help_quiet variable. This would reduce the flags to:
-h --help Show help on help
-m --man-page If possible, show man page, not HTML
-n --no-color Turn off colorization
-q --quiet Turn off informational messages
-t --text Don't use a graphical browser
I think this list is short, reasonable, and useful.
One more thought. If we want to make it easier for people to
customize their help, perhaps we could rename the current
help.fish to __help.fish or __fish_help.fish and then make a
help.fish that looks like:
function help --description "..."
# Add your default flags here before the $argv
__fish_help $argv
end
But that might entail adding --verbose, --html and --color
flags to counteract the --quiet, --man-page, and --no-color
flags so maybe this is too complicated.
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 [email protected] https://lists.sourceforge.net/lists/listinfo/fish-users
