+2014-04-27 Benno Schulenberg <bensberg@justemail.net>
+ * src/nano.c (usage, main): Don't blurt out the full help text
+ but just a hint when the command line contains some mistake, to
+ avoid drowning out the error message.
+
2014-04-27 Mark Majeres <mark@engine12.com>
* src/rcfile.c (parse_include): Plug two tiny memory leaks.
_("Option\t\tMeaning\n")
#endif
);
- print_opt("-h, -?", "--help", N_("Show this message"));
print_opt(_("+LINE,COLUMN"), "",
N_("Start at line LINE, column COLUMN"));
#ifndef NANO_TINY
print_opt("-d", "--rebinddelete",
N_("Fix Backspace/Delete confusion problem"));
#ifndef NANO_TINY
+ print_opt("-h", "--help", N_("Show this help text"));
print_opt("-i", "--autoindent",
N_("Automatically indent new lines"));
print_opt("-k", "--cut", N_("Cut from cursor to end of line"));
/* This is a special case. */
print_opt("-a, -b, -e,", "", NULL);
print_opt("-f, -g, -j", "", N_("(ignored, for Pico compatibility)"));
-
- exit(0);
}
/* Display the current version of nano, the date and time it was
while ((optchr =
#ifdef HAVE_GETOPT_LONG
getopt_long(argc, argv,
- "h?ABC:DEFGHIKLNOPQ:RST:UVWY:abcdefgijklmno:pqr:s:tuvwxz$",
+ "ABC:DEFGHIKLNOPQ:RST:UVWY:abcdefghijklmno:pqr:s:tuvwxz$",
long_options, NULL)
#else
getopt(argc, argv,
- "h?ABC:DEFGHIKLNOPQ:RST:UVWY:abcdefgijklmno:pqr:s:tuvwxz$")
+ "ABC:DEFGHIKLNOPQ:RST:UVWY:abcdefghijklmno:pqr:s:tuvwxz$")
#endif
) != -1) {
switch (optchr) {
SET(SOFTWRAP);
break;
#endif
- default:
+ case 'h':
usage();
+ exit(0);
+ default:
+ printf(_("Type '%s -h' for a list of available options.\n"), argv[0]);
+ exit(1);
}
}