[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Long help option
From: |
Adam Tuja |
Subject: |
Long help option |
Date: |
Tue, 23 Nov 2021 23:31:42 +0100 |
Hello,
there is a thing with the help (-h) that makes it increasingly harder to use - it's its length. With every next release it becomes bigger and bigger and does not fit on the screen any more. For the program that that makes it's simplicity an asset it's a little paradox. I attempted to make it simpler and fit on the screen. I slightly rearranged it with more application related things on the top and version and help, on the bottom. I used different kinds of brackets to denote optional/required/default/miscellaneous arguments*.
To recoclie both needs - brief, quick help and detailed information I brought long help option for detailed help (-H, --help-long).
All detailed help messages are available in long help option available.
I prepared three versions of main.cc, using different ways to implement this long help option - using if()s, like some do (main.cc-if-printf.cc), array (main.cc-arr.cc) and array with -hh option (main.cc-arr-hh.cc).
Everything is in temporal tarball (https://files.fm/f/eknq6kwys). There are no patches but you can get them by using included script.
I hope you find it worth employing.
* Utility Conventions for Utility Argument Syntax (https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html)
https://en.wikipedia.org/wiki/Command-line_interface#Command_description_syntax
- Long help option,
Adam Tuja <=