options: make -S the short synonym of --softwrap

The form -$ is still accepted, but is deprecated.
master
Benno Schulenberg 2020-03-27 16:57:25 +01:00
parent aa70f3d95e
commit 7d3aad403d
3 changed files with 25 additions and 30 deletions

View File

@ -175,6 +175,12 @@ different name if it already has one; and don't make backup files.
Restricted mode can also be activated by invoking \fBnano\fP Restricted mode can also be activated by invoking \fBnano\fP
with any name beginning with 'r' (e.g. "rnano"). with any name beginning with 'r' (e.g. "rnano").
.TP .TP
.BR \-S ", " \-\-softwrap
Display over multiple screen rows lines that exceed the screen's width.
(You can make this soft-wrapping occur at whitespace instead of rudely at
the screen's edge, by using also \fB\-\-atblanks\fR.)
(The old short option, \fB\-$\fR, is deprecated.)
.TP
.BR \-T\ \fInumber ", " \-\-tabsize= \fInumber .BR \-T\ \fInumber ", " \-\-tabsize= \fInumber
Set the size (width) of a tab to \fInumber\fP columns. The value of Set the size (width) of a tab to \fInumber\fP columns. The value of
\fInumber\fP must be greater than 0. The default value is 8. \fInumber\fP must be greater than 0. The default value is 8.
@ -312,15 +318,6 @@ Make Ctrl+Right stop at word ends instead of beginnings.
.TP .TP
.BR \-z ", " \-\-suspendable .BR \-z ", " \-\-suspendable
Allow the user to suspend the editor (with \fB^Z\fR by default). Allow the user to suspend the editor (with \fB^Z\fR by default).
.TP
.BR \-$ ", " \-\-softwrap
Display lines that exceed the screen's width over multiple screen lines.
(You can make this soft-wrapping occur at whitespace instead of rudely at
the screen's edge, by using also \fB\-\-atblanks\fR.)
Since
\&'$' normally refers to a variable in the Unix shell, you should specify
this option last when using other options (e.g.\& 'nano \-wS$') or pass it
separately (e.g.\& 'nano \-wS \-$').
.SH TOGGLES .SH TOGGLES
Several of the above options can be switched on and off also while Several of the above options can be switched on and off also while

View File

@ -262,6 +262,13 @@ name if it already has one; and don't make backup files.
Restricted mode can also be activated by invoking @command{nano} with Restricted mode can also be activated by invoking @command{nano} with
any name beginning with @code{r} (e.g.@: @command{rnano}). any name beginning with @code{r} (e.g.@: @command{rnano}).
@item -S
@itemx --softwrap
Display over multiple screen rows lines that exceed the screen's width.
(You can make this soft-wrapping occur at whitespace instead of rudely at
the screen's edge, by using also @code{--atblanks}.)
(The old short option, @code{-$}, is deprecated.)
@item -T @var{number} @item -T @var{number}
@itemx --tabsize=@var{number} @itemx --tabsize=@var{number}
Set the displayed tab length to @var{number} columns. The value of Set the displayed tab length to @var{number} columns. The value of
@ -448,16 +455,6 @@ Make Ctrl+Right stop at word ends instead of beginnings.
Enable the ability to suspend @command{nano} using the system's suspend Enable the ability to suspend @command{nano} using the system's suspend
keystroke (usually @kbd{^Z}). keystroke (usually @kbd{^Z}).
@item -$
@itemx --softwrap
Display lines that exceed the screen's width over multiple screen lines.
(You can make this soft-wrapping occur at whitespace instead of rudely at
the screen's edge, by using also @code{--atblanks}.)
Since
@code{$} normally refers to a variable in the Unix shell, you should specify
this option last when using other options (e.g.@: @code{nano -wS$}) or pass it
separately (e.g.@: @code{nano -wS -$}).
@end table @end table
@ -661,7 +658,7 @@ The following global toggles are available:
@kbd{Meta-P} toggles the displaying of whitespace (@pxref{Whitespace}). @kbd{Meta-P} toggles the displaying of whitespace (@pxref{Whitespace}).
@item Soft Wrapping @item Soft Wrapping
@kbd{Meta-S} toggles the @option{-$} (@option{--softwrap}) command-line option. @kbd{Meta-S} toggles the @option{-S} (@option{--softwrap}) command-line option.
@item Expert/No Help @item Expert/No Help
@kbd{Meta-X} toggles the @option{-x} (@option{--nohelp}) command-line option. @kbd{Meta-X} toggles the @option{-x} (@option{--nohelp}) command-line option.

View File

@ -594,6 +594,9 @@ void usage(void)
#endif #endif
if (!ISSET(RESTRICTED)) if (!ISSET(RESTRICTED))
print_opt("-R", "--restricted", N_("Restrict access to the filesystem")); print_opt("-R", "--restricted", N_("Restrict access to the filesystem"));
#ifndef NANO_TINY
print_opt("-S", "--softwrap", N_("Display overlong lines on multiple rows"));
#endif
print_opt(_("-T <#cols>"), _("--tabsize=<#cols>"), print_opt(_("-T <#cols>"), _("--tabsize=<#cols>"),
N_("Set width of a tab to #cols columns")); N_("Set width of a tab to #cols columns"));
print_opt("-U", "--quickblank", N_("Wipe status bar upon next keystroke")); print_opt("-U", "--quickblank", N_("Wipe status bar upon next keystroke"));
@ -670,9 +673,6 @@ void usage(void)
#endif #endif
if (!ISSET(RESTRICTED)) if (!ISSET(RESTRICTED))
print_opt("-z", "--suspendable", N_("Enable suspension")); print_opt("-z", "--suspendable", N_("Enable suspension"));
#ifndef NANO_TINY
print_opt("-$", "--softwrap", N_("Display overlong lines on multiple rows"));
#endif
} }
/* Display the current version of nano, the date and time it was /* Display the current version of nano, the date and time it was
@ -1817,6 +1817,7 @@ int main(int argc, char **argv)
{"nonewlines", 0, NULL, 'L'}, {"nonewlines", 0, NULL, 'L'},
{"noconvert", 0, NULL, 'N'}, {"noconvert", 0, NULL, 'N'},
{"positionlog", 0, NULL, 'P'}, {"positionlog", 0, NULL, 'P'},
{"softwrap", 0, NULL, 'S'},
{"wordbounds", 0, NULL, 'W'}, {"wordbounds", 0, NULL, 'W'},
{"wordchars", 1, NULL, 'X'}, {"wordchars", 1, NULL, 'X'},
{"zap", 0, NULL, 'Z'}, {"zap", 0, NULL, 'Z'},
@ -1825,7 +1826,6 @@ int main(int argc, char **argv)
{"cutfromcursor", 0, NULL, 'k'}, {"cutfromcursor", 0, NULL, 'k'},
{"unix", 0, NULL, 'u'}, {"unix", 0, NULL, 'u'},
{"afterends", 0, NULL, 'y'}, {"afterends", 0, NULL, 'y'},
{"softwrap", 0, NULL, '$'},
#endif #endif
{NULL, 0, NULL, 0} {NULL, 0, NULL, 0}
}; };
@ -1881,7 +1881,7 @@ int main(int argc, char **argv)
if (*(tail(argv[0])) == 'r') if (*(tail(argv[0])) == 'r')
SET(RESTRICTED); SET(RESTRICTED);
while ((optchr = getopt_long(argc, argv, "ABC:DEFGHIJ:KLMNPQ:RT:UVWX:Y:Z" while ((optchr = getopt_long(argc, argv, "ABC:DEFGHIJ:KLMNPQ:RST:UVWX:Y:Z"
"abcdef:ghijklmno:pr:s:tuvwxyz$", long_options, NULL)) != -1) { "abcdef:ghijklmno:pr:s:tuvwxyz$", long_options, NULL)) != -1) {
switch (optchr) { switch (optchr) {
#ifndef NANO_TINY #ifndef NANO_TINY
@ -1963,6 +1963,12 @@ int main(int argc, char **argv)
case 'R': case 'R':
SET(RESTRICTED); SET(RESTRICTED);
break; break;
#ifndef NANO_TINY
case 'S':
case '$': /* Deprecated; remove in 2024. */
SET(SOFTWRAP);
break;
#endif
case 'T': case 'T':
if (!parse_num(optarg, &tabsize) || tabsize <= 0) { if (!parse_num(optarg, &tabsize) || tabsize <= 0) {
fprintf(stderr, _("Requested tab size \"%s\" is invalid"), optarg); fprintf(stderr, _("Requested tab size \"%s\" is invalid"), optarg);
@ -2102,11 +2108,6 @@ int main(int argc, char **argv)
case 'z': case 'z':
SET(SUSPENDABLE); SET(SUSPENDABLE);
break; break;
#ifndef NANO_TINY
case '$':
SET(SOFTWRAP);
break;
#endif
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);