From 93a552b2322e84ea71c67d8060da29566ae9f478 Mon Sep 17 00:00:00 2001 From: Anton Lindqvist Date: Tue, 31 Dec 2019 10:31:00 +0100 Subject: [PATCH] remove help option Use the manual instead. --- Makefile | 1 - pick.1 | 4 +--- pick.c | 18 +++++++----------- tests/Makefile | 1 - tests/opt-h.t | 2 -- 5 files changed, 8 insertions(+), 18 deletions(-) delete mode 100644 tests/opt-h.t diff --git a/Makefile b/Makefile index 79e3fc1d..262398fc 100644 --- a/Makefile +++ b/Makefile @@ -55,7 +55,6 @@ DISTFILES+= tests/key-unknown.t DISTFILES+= tests/misc-match.t DISTFILES+= tests/misc-realloc.t DISTFILES+= tests/opt-d.t -DISTFILES+= tests/opt-h.t DISTFILES+= tests/opt-k.t DISTFILES+= tests/opt-o.t DISTFILES+= tests/opt-q.t diff --git a/pick.1 b/pick.1 index a03cf6db..18714389 100644 --- a/pick.1 +++ b/pick.1 @@ -6,7 +6,7 @@ .Nd fuzzy select anything .Sh SYNOPSIS .Nm -.Op Fl dhKoSXx +.Op Fl dKoSXx .Op Fl q Ar query .Sh DESCRIPTION The @@ -28,8 +28,6 @@ Input lines will be split into two parts by the last occurrence of .Ev IFS . Both parts will be displayed but only the first part will be used when searching. -.It Fl h -Output a help message and exit. .It Fl K Disable toggling of keypad transmit mode. Useful when running diff --git a/pick.c b/pick.c index 2ade5747..b3aa25a2 100644 --- a/pick.c +++ b/pick.c @@ -82,7 +82,7 @@ static const char *tty_parm1(char *, int); static int tty_putc(int); static void tty_restore(int); static void tty_size(void); -static __dead void usage(int); +static __dead void usage(void); static int xmbtowc(wchar_t *, const char *); static struct termios tio; @@ -115,13 +115,11 @@ main(int argc, char *argv[]) if (pledge("stdio tty rpath wpath cpath", NULL) == -1) err(1, "pledge"); - while ((c = getopt(argc, argv, "dhoq:KSxX")) != -1) + while ((c = getopt(argc, argv, "doq:KSxX")) != -1) switch (c) { case 'd': descriptions = 1; break; - case 'h': - usage(0); case 'K': use_keypad = 0; break; @@ -148,12 +146,12 @@ main(int argc, char *argv[]) use_alternate_screen = 0; break; default: - usage(1); + usage(); } argc -= optind; argv += optind; if (argc > 0) - usage(1); + usage(); if (query == NULL) { query_size = 64; @@ -185,10 +183,9 @@ main(int argc, char *argv[]) } __dead void -usage(int status) +usage(void) { - fprintf(stderr, "usage: pick [-dhKoSXx] [-q query]\n" - " -h output this help message and exit\n" + fprintf(stderr, "usage: pick [-dKoSXx] [-q query]\n" " -K disable toggling of keypad transmit mode\n" " -S disable sorting\n" " -d read and display descriptions\n" @@ -196,8 +193,7 @@ usage(int status) " -x enable alternate screen\n" " -X disable alternate screen\n" " -q query supply an initial search query\n"); - - exit(status); + exit(1); } char * diff --git a/tests/Makefile b/tests/Makefile index ae0a7871..2f027b9e 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -35,7 +35,6 @@ TESTS+= key-unknown.t TESTS+= misc-match.t TESTS+= misc-realloc.t TESTS+= opt-d.t -TESTS+= opt-h.t TESTS+= opt-k.t TESTS+= opt-o.t TESTS+= opt-q.t diff --git a/tests/opt-h.t b/tests/opt-h.t deleted file mode 100644 index c24e468d..00000000 --- a/tests/opt-h.t +++ /dev/null @@ -1,2 +0,0 @@ -description: output help -args: -h