build: exclude --emptyline, --jumpyscrolling, and --noread from tiny nano

When looking at the output of 'nano --help', why confuse the user with
a cosmetic option, an awkward behavioral one, and an obscure one?
master
Benno Schulenberg 2020-09-21 17:04:10 +02:00
parent cb56cd70f5
commit c3e74f02c2
3 changed files with 17 additions and 9 deletions

View File

@ -115,6 +115,7 @@ void do_page_up(void)
int mustmove = (editwinrows < 3) ? 1 : editwinrows - 2; int mustmove = (editwinrows < 3) ? 1 : editwinrows - 2;
size_t leftedge, target_column; size_t leftedge, target_column;
#ifndef NANO_TINY
/* If we're not in smooth scrolling mode, put the cursor at the /* If we're not in smooth scrolling mode, put the cursor at the
* beginning of the top line of the edit window, as Pico does. */ * beginning of the top line of the edit window, as Pico does. */
if (ISSET(JUMPY_SCROLLING)) { if (ISSET(JUMPY_SCROLLING)) {
@ -123,6 +124,7 @@ void do_page_up(void)
openfile->current_y = 0; openfile->current_y = 0;
target_column = 0; target_column = 0;
} else } else
#endif
get_edge_and_target(&leftedge, &target_column); get_edge_and_target(&leftedge, &target_column);
/* Move up the required number of lines or chunks. If we can't, we're /* Move up the required number of lines or chunks. If we can't, we're
@ -145,6 +147,7 @@ void do_page_down(void)
int mustmove = (editwinrows < 3) ? 1 : editwinrows - 2; int mustmove = (editwinrows < 3) ? 1 : editwinrows - 2;
size_t leftedge, target_column; size_t leftedge, target_column;
#ifndef NANO_TINY
/* If we're not in smooth scrolling mode, put the cursor at the /* If we're not in smooth scrolling mode, put the cursor at the
* beginning of the top line of the edit window, as Pico does. */ * beginning of the top line of the edit window, as Pico does. */
if (ISSET(JUMPY_SCROLLING)) { if (ISSET(JUMPY_SCROLLING)) {
@ -153,6 +156,7 @@ void do_page_down(void)
openfile->current_y = 0; openfile->current_y = 0;
target_column = 0; target_column = 0;
} else } else
#endif
get_edge_and_target(&leftedge, &target_column); get_edge_and_target(&leftedge, &target_column);
/* Move down the required number of lines or chunks. If we can't, we're /* Move down the required number of lines or chunks. If we can't, we're

View File

@ -587,7 +587,9 @@ void usage(void)
print_opt("-c", "--constantshow", N_("Constantly show cursor position")); print_opt("-c", "--constantshow", N_("Constantly show cursor position"));
print_opt("-d", "--rebinddelete", print_opt("-d", "--rebinddelete",
N_("Fix Backspace/Delete confusion problem")); N_("Fix Backspace/Delete confusion problem"));
#ifndef NANO_TINY
print_opt("-e", "--emptyline", N_("Keep the line below the title bar empty")); print_opt("-e", "--emptyline", N_("Keep the line below the title bar empty"));
#endif
#ifdef ENABLE_NANORC #ifdef ENABLE_NANORC
print_opt(_("-f <file>"), _("--rcfile=<file>"), print_opt(_("-f <file>"), _("--rcfile=<file>"),
N_("Use only this file for configuring nano")); N_("Use only this file for configuring nano"));
@ -598,9 +600,7 @@ void usage(void)
print_opt("-h", "--help", N_("Show this help text and exit")); print_opt("-h", "--help", N_("Show this help text and exit"));
#ifndef NANO_TINY #ifndef NANO_TINY
print_opt("-i", "--autoindent", N_("Automatically indent new lines")); print_opt("-i", "--autoindent", N_("Automatically indent new lines"));
#endif
print_opt("-j", "--jumpyscrolling", N_("Scroll per half-screen, not per line")); print_opt("-j", "--jumpyscrolling", N_("Scroll per half-screen, not per line"));
#ifndef NANO_TINY
print_opt("-k", "--cutfromcursor", N_("Cut from cursor to end of line")); print_opt("-k", "--cutfromcursor", N_("Cut from cursor to end of line"));
#endif #endif
#ifdef ENABLE_LINENUMBERS #ifdef ENABLE_LINENUMBERS
@ -609,7 +609,9 @@ void usage(void)
#ifdef ENABLE_MOUSE #ifdef ENABLE_MOUSE
print_opt("-m", "--mouse", N_("Enable the use of the mouse")); print_opt("-m", "--mouse", N_("Enable the use of the mouse"));
#endif #endif
#ifndef NANO_TINY
print_opt("-n", "--noread", N_("Do not read the file (only write it)")); print_opt("-n", "--noread", N_("Do not read the file (only write it)"));
#endif
#ifdef ENABLE_OPERATINGDIR #ifdef ENABLE_OPERATINGDIR
print_opt(_("-o <dir>"), _("--operatingdir=<dir>"), print_opt(_("-o <dir>"), _("--operatingdir=<dir>"),
N_("Set operating directory")); N_("Set operating directory"));
@ -1716,7 +1718,6 @@ int main(int argc, char **argv)
#endif #endif
{"constantshow", 0, NULL, 'c'}, {"constantshow", 0, NULL, 'c'},
{"rebinddelete", 0, NULL, 'd'}, {"rebinddelete", 0, NULL, 'd'},
{"emptyline", 0, NULL, 'e'},
#ifdef ENABLE_NANORC #ifdef ENABLE_NANORC
{"rcfile", 1, NULL, 'f'}, {"rcfile", 1, NULL, 'f'},
#endif #endif
@ -1724,14 +1725,12 @@ int main(int argc, char **argv)
{"showcursor", 0, NULL, 'g'}, {"showcursor", 0, NULL, 'g'},
#endif #endif
{"help", 0, NULL, 'h'}, {"help", 0, NULL, 'h'},
{"jumpyscrolling", 0, NULL, 'j'},
#ifdef ENABLE_LINENUMBERS #ifdef ENABLE_LINENUMBERS
{"linenumbers", 0, NULL, 'l'}, {"linenumbers", 0, NULL, 'l'},
#endif #endif
#ifdef ENABLE_MOUSE #ifdef ENABLE_MOUSE
{"mouse", 0, NULL, 'm'}, {"mouse", 0, NULL, 'm'},
#endif #endif
{"noread", 0, NULL, 'n'},
#ifdef ENABLE_OPERATINGDIR #ifdef ENABLE_OPERATINGDIR
{"operatingdir", 1, NULL, 'o'}, {"operatingdir", 1, NULL, 'o'},
#endif #endif
@ -1767,8 +1766,11 @@ int main(int argc, char **argv)
{"wordchars", 1, NULL, 'X'}, {"wordchars", 1, NULL, 'X'},
{"zap", 0, NULL, 'Z'}, {"zap", 0, NULL, 'Z'},
{"atblanks", 0, NULL, 'a'}, {"atblanks", 0, NULL, 'a'},
{"emptyline", 0, NULL, 'e'},
{"autoindent", 0, NULL, 'i'}, {"autoindent", 0, NULL, 'i'},
{"jumpyscrolling", 0, NULL, 'j'},
{"cutfromcursor", 0, NULL, 'k'}, {"cutfromcursor", 0, NULL, 'k'},
{"noread", 0, NULL, 'n'},
{"indicator", 0, NULL, 'q'}, {"indicator", 0, NULL, 'q'},
{"unix", 0, NULL, 'u'}, {"unix", 0, NULL, 'u'},
{"afterends", 0, NULL, 'y'}, {"afterends", 0, NULL, 'y'},
@ -1965,9 +1967,11 @@ int main(int argc, char **argv)
case 'd': case 'd':
SET(REBIND_DELETE); SET(REBIND_DELETE);
break; break;
#ifndef NANO_TINY
case 'e': case 'e':
SET(EMPTY_LINE); SET(EMPTY_LINE);
break; break;
#endif
#ifdef ENABLE_NANORC #ifdef ENABLE_NANORC
case 'f': case 'f':
custom_nanorc = mallocstrcpy(custom_nanorc, optarg); custom_nanorc = mallocstrcpy(custom_nanorc, optarg);
@ -1985,11 +1989,9 @@ int main(int argc, char **argv)
case 'i': case 'i':
SET(AUTOINDENT); SET(AUTOINDENT);
break; break;
#endif
case 'j': case 'j':
SET(JUMPY_SCROLLING); SET(JUMPY_SCROLLING);
break; break;
#ifndef NANO_TINY
case 'k': case 'k':
SET(CUT_FROM_CURSOR); SET(CUT_FROM_CURSOR);
break; break;
@ -2004,9 +2006,11 @@ int main(int argc, char **argv)
SET(USE_MOUSE); SET(USE_MOUSE);
break; break;
#endif #endif
#ifndef NANO_TINY
case 'n': case 'n':
SET(NOREAD_MODE); SET(NOREAD_MODE);
break; break;
#endif
#ifdef ENABLE_OPERATINGDIR #ifdef ENABLE_OPERATINGDIR
case 'o': case 'o':
operating_dir = mallocstrcpy(operating_dir, optarg); operating_dir = mallocstrcpy(operating_dir, optarg);

View File

@ -48,14 +48,12 @@ static const rcoption rcopts[] = {
#endif #endif
{"casesensitive", CASE_SENSITIVE}, {"casesensitive", CASE_SENSITIVE},
{"constantshow", CONSTANT_SHOW}, {"constantshow", CONSTANT_SHOW},
{"emptyline", EMPTY_LINE},
#ifdef ENABLED_WRAPORJUSTIFY #ifdef ENABLED_WRAPORJUSTIFY
{"fill", 0}, {"fill", 0},
#endif #endif
#ifdef ENABLE_HISTORIES #ifdef ENABLE_HISTORIES
{"historylog", HISTORYLOG}, {"historylog", HISTORYLOG},
#endif #endif
{"jumpyscrolling", JUMPY_SCROLLING},
#ifdef ENABLE_LINENUMBERS #ifdef ENABLE_LINENUMBERS
{"linenumbers", LINE_NUMBERS}, {"linenumbers", LINE_NUMBERS},
#endif #endif
@ -105,8 +103,10 @@ static const rcoption rcopts[] = {
{"backupdir", 0}, {"backupdir", 0},
{"bookstyle", BOOKSTYLE}, {"bookstyle", BOOKSTYLE},
{"cutfromcursor", CUT_FROM_CURSOR}, {"cutfromcursor", CUT_FROM_CURSOR},
{"emptyline", EMPTY_LINE},
{"guidestripe", 0}, {"guidestripe", 0},
{"indicator", INDICATOR}, {"indicator", INDICATOR},
{"jumpyscrolling", JUMPY_SCROLLING},
{"locking", LOCKING}, {"locking", LOCKING},
{"matchbrackets", 0}, {"matchbrackets", 0},
{"noconvert", NO_CONVERT}, {"noconvert", NO_CONVERT},