Open Explorer09 opened 6 years ago
The predefined command-line options is merely a reference design and provided to be freely customized by the user (like print_help
and process_commandline_arguments
these definitions aren't in GBSST's support code at all, it is considered that if one doesn't use it one simply remove the relevant lines in print_help
, process_commandline_arguments
and COMMANDLINE_OPTION_*
)
The reason that COMMANDLINE_OPTION_DISPLAY_HELP_*
is separately defined is that it can be (re)used in print_help
and process_commandline_arguments
, which might be dropped in the future as copying it twice doesn't seem to be a large trade-off.
Hope that answers your question.
I would suggest you drop COMMANDLINE_OPTION_DISPLAY_HELP_*
fow two reasons:
--help
is probably a fixed convention these days that does not need configurabilty any longer.
The template seems to deliberately reserve
-h
flag for the predefined--help
option. While I appreciate that some shell scripts do use-h
for help option (for user convenience), but what's the rationale of imposing it in the template? My concern is that-h
could be used for other things depending on application (one use that came to my mind is--no-dereference
in utilities such astouch
andchown
), and applications should be able to let help text be invoked only via the long--help
option.Another problem I observed is when COMMANDLINE_OPTION_DISPLAY_HELP_SHORT is set to empty, then an empty argument string
''
might trigger the help text display. What I expected is that it would disable the short option for help text and accept only the long option for help.