public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [committed] Add --help option in usage
@ 2019-01-01  0:00 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2019-01-01  0:00 UTC (permalink / raw)
  To: dwz, jakub

Hi,

The option -? (short for --help) shows the usage, but is itself not listed in
the usage:
...
$ dwz -?
dwz: Usage:
  dwz [-v] [-q] [-l <COUNT|none>] [-L <COUNT|none>] [-h] [-m COMMONFILE] \
    [-M NAME | -r] [FILES]
  dwz [-v] [-q] [-l <COUNT|none>] [-L <COUNT|none>] -o OUTFILE FILE
...

Furthermore, the -v option is listed as common option, but like -?, stops
regular processing after printing a message.

List these two together in a new usage line, and show them as exclusive to
indicate that only one can have effect:
...
  dwz [-q] [-l <COUNT|none>] [-L <COUNT|none>] [-h] [-m COMMONFILE] \
    [-M NAME | -r] [FILES]
  dwz [-q] [-l <COUNT|none>] [-L <COUNT|none>] -o OUTFILE FILE
  dwz [ -v | -? ]
...

Committed to trunk.

Thanks,
- Tom

Add --help option in usage

2019-12-11  Tom de Vries  <tdevries@suse.de>

	* dwz.c (COMMON_OPTS): Drop -v.
	(usage): Add line advertising -? and -v.

---
 dwz.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dwz.c b/dwz.c
index 900bfc3..d83a1cf 100644
--- a/dwz.c
+++ b/dwz.c
@@ -13363,11 +13363,12 @@ static struct option dwz_options[] =
 static void
 usage (void)
 {
-#define COMMON_OPTS "[-v] [-q] [-l <COUNT|none>] [-L <COUNT|none>]"
+#define COMMON_OPTS "[-q] [-l <COUNT|none>] [-L <COUNT|none>]"
   error (1, 0,
 	 "Usage:\n"
 	 "  dwz " COMMON_OPTS " [-h] [-m COMMONFILE] [-M NAME | -r] [FILES]\n"
 	 "  dwz " COMMON_OPTS " -o OUTFILE FILE\n"
+	 "  dwz [ -v | -? ]\n"
 #undef COMMON_OPTS
 #if DEVEL
 	 "Development options:\n"

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-12-11 14:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-01  0:00 [committed] Add --help option in usage Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).