Allow better formatting of --help
I find the --help
output of various of my programs a bit hard to read fast, because there are too many command-line options to be parsed in one look, so I’d like to find a way to improve that. For Iagno, for example, currently, it looks like that, options being in alphabetical order:
Usage:
iagno [OPTION?]
Help Options:
-h, --help Show help options
--help-all Show all help options
--help-gapplication Show GApplication options
--help-gtk Show GTK+ Options
Application Options:
--alternative-start Start with an alternative position
--classic Play Classic Reversi
-f, --fast-mode Reduce delay before AI moves
--first Play first
-l, --level=LEVEL Set the level of the computer’s AI
--mute Turn off the sound
--random-start Start with a random position
--reverse Play Reverse Reversi
--second Play second
-s, --size=SIZE Size of the board (debug only)
--two-players Two-players mode
--unmute Turn on the sound
--usual-start Start with the usual position
-v, --version Print release version and exit
--display=DISPLAY X display to use
Trying to group them by category is a bit unclear also, as you don’t know where a type of option starts and ends:
<snip>
Application Options:
--classic Play Classic Reversi
--reverse Play Reverse Reversi
--first Play first
--second Play second
--two-players Two-players mode
-l, --level=LEVEL Set the level of the computer’s AI
--usual-start Start with the usual position
--alternative-start Start with an alternative position
--random-start Start with a random position
--mute Turn off the sound
--unmute Turn on the sound
-f, --fast-mode Reduce delay before AI moves
-s, --size=SIZE Size of the board (debug only)
-v, --version Print release version and exit
--display=DISPLAY X display to use
So I suggest adding an easy way to introduce empty lines, and I find that really better:
<snip>
Application Options:
--classic Play Classic Reversi
--reverse Play Reverse Reversi
--first Play first
--second Play second
--two-players Two-players mode
-l, --level=LEVEL Set the level of the computer’s AI
--usual-start Start with the usual position
--alternative-start Start with an alternative position
--random-start Start with a random position
--mute Turn off the sound
--unmute Turn on the sound
-f, --fast-mode Reduce delay before AI moves
-s, --size=SIZE Size of the board (debug only)
-v, --version Print release version and exit
--display=DISPLAY X display to use
Changing strings to add a \n
is an option, but it means that if I add to a category a new option, or change categories, translators will have more work as they will have to remove/add some \n
.
I opened !1100 (closed) that allows to do that easily by adding a new G_OPTION_FLAG_APPEND_EMPTY_LINE.