tweaks: put check for -h and -l options in their alphabetical positions

And put the Pico-compatibility flags last, as normally they are never
given.
master
Benno Schulenberg 2018-05-12 19:44:14 +02:00
parent cecf453b14
commit ae1ba5e259
1 changed files with 12 additions and 13 deletions

View File

@ -2070,12 +2070,6 @@ int main(int argc, char **argv)
"ABC:DEFGHIKLMNOPQ:RST:UVWX:Y:abcdefghijklmno:pqr:s:tuvwxyz$", "ABC:DEFGHIKLMNOPQ:RST:UVWX:Y:abcdefghijklmno:pqr:s:tuvwxyz$",
long_options, NULL)) != -1) { long_options, NULL)) != -1) {
switch (optchr) { switch (optchr) {
case 'b':
case 'e':
case 'f':
case 'j':
/* Pico compatibility flags. */
break;
#ifndef NANO_TINY #ifndef NANO_TINY
case 'A': case 'A':
SET(SMART_HOME); SET(SMART_HOME);
@ -2192,6 +2186,9 @@ int main(int argc, char **argv)
case 'g': case 'g':
SET(SHOW_CURSOR); SET(SHOW_CURSOR);
break; break;
case 'h':
usage();
exit(0);
#ifndef NANO_TINY #ifndef NANO_TINY
case 'i': case 'i':
SET(AUTOINDENT); SET(AUTOINDENT);
@ -2200,6 +2197,11 @@ int main(int argc, char **argv)
SET(CUT_FROM_CURSOR); SET(CUT_FROM_CURSOR);
break; break;
#endif #endif
#ifdef ENABLE_LINENUMBERS
case 'l':
SET(LINE_NUMBERS);
break;
#endif
#ifdef ENABLE_MOUSE #ifdef ENABLE_MOUSE
case 'm': case 'm':
SET(USE_MOUSE); SET(USE_MOUSE);
@ -2275,14 +2277,11 @@ int main(int argc, char **argv)
SET(SOFTWRAP); SET(SOFTWRAP);
break; break;
#endif #endif
#ifdef ENABLE_LINENUMBERS case 'b': /* Pico compatibility flags. */
case 'l': case 'e':
SET(LINE_NUMBERS); case 'f':
case 'j':
break; break;
#endif
case 'h':
usage();
exit(0);
default: default:
printf(_("Type '%s -h' for a list of available options.\n"), argv[0]); printf(_("Type '%s -h' for a list of available options.\n"), argv[0]);
exit(1); exit(1);