commit 5bd92d4c60447c1762df0ce3f5e67f551f894e4b
parent d6c194265fcc526aebf2ee41dee65ea03ba8da5a
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Thu, 1 Oct 2020 10:45:22 +0200
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.
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git 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