pgetopt: change the -?/--usage and -h/--help option semantics #10

Closed
opened 2020-08-05 15:13:28 +02:00 by ni · 4 comments
ni commented 2020-08-05 15:13:28 +02:00 (Migrated from git.w21.org)

Turns out the -h is in the way more often than I thought, as in programs that want to display large numbers in the Mega, Giga, Tera range as "human readable" with a suffix, like du and df. Maybe it is time to free it.

Ideas:

  • Make -? the main option for usage and help, meaning it prints the full help message including the usage. It shouldn't be in the way at all. What about --usage — will I still need/want it at all?
  • On a usage error, print just the usage message, with a referral to -? (just as it now refers to -h).
  • If the using program does not use -h, make it an alias to -?.
  • --help must stay — I am not its biggest fan, but it is the GNU/Linux standard.

Sounds like a good plan if I have more than 10 KB.

Turns out the `-h` is in the way more often than I thought, as in programs that want to display large numbers in the Mega, Giga, Tera range as "human readable" with a suffix, like `du` and `df`. Maybe it is time to free it. Ideas: - Make `-?` the main option for usage *and* help, meaning it prints the full help message including the usage. It shouldn't be in the way at all. What about `--usage` — will I still need/want it at all? - On a usage error, print just the usage message, with a referral to `-?` (just as it now refers to `-h`). - If the using program does not use `-h`, make it an alias to `-?`. - `--help` must stay — I am not its biggest fan, but it is the GNU/Linux standard. Sounds like a good plan if I have more than 10 KB.
ni commented 2020-08-06 13:50:07 +02:00 (Migrated from git.w21.org)

changed title from pgetopt: slight change of the -?/--usage and -h/--help options to pgetopt: slight change of the -?/--usage and -h/--help option{+ semantic+}s

changed title from **pgetopt: slight change of the -?/--usage and -h/--help options** to **pgetopt: slight change of the -?/--usage and -h/--help option{+ semantic+}s**
ni commented 2020-08-06 13:50:24 +02:00 (Migrated from git.w21.org)

changed title from pgetopt: {-slight change of-} the -?/--usage and -h/--help option semantics to pgetopt: {+change+} the -?/--usage and -h/--help option semantics

changed title from **pgetopt: {-slight change of-} the -?/--usage and -h/--help option semantics** to **pgetopt: {+change+} the -?/--usage and -h/--help option semantics**
ni commented 2020-08-08 13:48:56 +02:00 (Migrated from git.w21.org)

Yes, I definitely think it is time to free the -h option for the using program. Commencing.

Yes, I definitely think it is time to free the `-h` option for the using program. Commencing.
ni commented 2020-08-08 14:25:16 +02:00 (Migrated from git.w21.org)

closed via commit c6ab7576d8

closed via commit c6ab7576d8c7adc0ef774ce87be84ea2f85e8af7
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
w21/jpylib#10
No description provided.