diff options
author | Paul A. Patience <paul@apatience.com> | 2022-02-08 11:39:42 +0000 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-02-08 08:08:38 -0800 |
commit | 7783f13a2994ae144c05e2bafbe8a76eef39b028 (patch) | |
tree | a24c472523721150f66eaf5d74fb26c0ed82f9e4 | |
parent | 1d9195a85f1f745b6bdad46ecadb116f60d0bf0d (diff) | |
download | txr-7783f13a2994ae144c05e2bafbe8a76eef39b028.tar.gz txr-7783f13a2994ae144c05e2bafbe8a76eef39b028.tar.bz2 txr-7783f13a2994ae144c05e2bafbe8a76eef39b028.zip |
getopts: fix de trop descriptions of conventions.
* stdlib/getopts.tl (opthelp-conventions): Describe the --no-
prefix only if we have boolean options, and describe the
long-option argument style only if we have long options.
-rw-r--r-- | stdlib/getopts.tl | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/stdlib/getopts.tl b/stdlib/getopts.tl index 87b060e4..18bec996 100644 --- a/stdlib/getopts.tl +++ b/stdlib/getopts.tl @@ -330,24 +330,26 @@ "All options are Boolean:"))) (if have-bool "they are true when present, false when absent.") - (if (and have-bool have-arg-p) - "The --no- prefix can explicitly specify \ \ - Boolean options as false: if a Boolean option\ \ - X exists,\ \ - --no-X specifies it as false. This is useful\ \ - for making false those options which default\ \ - to true. " - "The --no- prefix can explicitly specify \ \ - options as false: if an X option exists,\ \ - --no-X specifies it as false. This is useful\ \ - for making false those options which default\ \ - to true. ") - (if (not have-long) - "Note the double dash on --no.") - (if (and have-short have-long) - "The --no- prefix can be applied to a short\ \ - or long option name.") - (if have-arg-p + (if have-bool + (if have-arg-p + "The --no- prefix can explicitly specify\ \ + Boolean options as false: if a Boolean option\ \ + X exists,\ \ + --no-X specifies it as false. This is useful\ \ + for making false those options which default\ \ + to true." + "The --no- prefix can explicitly specify\ \ + options as false: if an X option exists,\ \ + --no-X specifies it as false. This is useful\ \ + for making false those options which default\ \ + to true.")) + (if have-bool + (if (not have-long) + "Note the double dash on --no." + (if have-short + "The --no- prefix can be applied to a short\ \ + or long option name."))) + (if (and have-long have-arg-p) "The argument to a long option can be given in one\ \ argument as --option=arg or as a separate\ \ argument using --option arg.") |