From 5bd92d4c60447c1762df0ce3f5e67f551f894e4b Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Thu, 1 Oct 2020 10:45:22 +0200 Subject: [PATCH] options: add -? as a synonym of -h (--help), but leave it undocumented This option was lost six years ago in commit 43019189, without giving a reason for it. It's not really needed, but it doesn't hurt to have it. --- src/nano.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nano.c b/src/nano.c index cf607db0..35e36a2c 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1850,7 +1850,7 @@ int main(int argc, char **argv) SET(RESTRICTED); while ((optchr = getopt_long(argc, argv, "!%ABC:DEFGHIJ:KLMNOPQ:RST:UVWX:Y:Z" - "abcdef:ghijklmno:pqr:s:tuvwxyz$", long_options, NULL)) != -1) { + "abcdef:ghijklmno:pqr:s:tuvwxyz$?", long_options, NULL)) != -1) { switch (optchr) { #ifdef HAVE_LIBMAGIC case '!': @@ -2011,6 +2011,7 @@ int main(int argc, char **argv) break; #endif case 'h': + case '?': usage(); exit(0); #ifndef NANO_TINY