options: recognize -a and --atblanks on the command line
In nano, -a is only effective when also -$ is given, so this will not conflict with Pico since Pico does not know the -$ option.
Этот коммит содержится в:
родитель
09723b07a8
Коммит
ac7a071893
@ -164,6 +164,10 @@ should be considered as part of a word. This overrides option
|
||||
Specify the name of the syntax highlighting to use from among the ones
|
||||
defined in the \fInanorc\fP files.
|
||||
.TP
|
||||
.BR \-a ", " \-\-atblanks
|
||||
When doing soft line wrapping, wrap lines at whitespace
|
||||
instead of always at the edge of the screen.
|
||||
.TP
|
||||
.BR \-c ", " \-\-constantshow
|
||||
Constantly show the cursor position on the status bar.
|
||||
Note that this overrides option \fB\-U\fR (\fB\-\-quickblank\fR).
|
||||
@ -256,7 +260,7 @@ continuing it over multiple screen lines. Since
|
||||
this option last when using other options (e.g.\& 'nano \-wS$') or pass it
|
||||
separately (e.g.\& 'nano \-wS \-$').
|
||||
.TP
|
||||
.BR \-a ", " \-b ", " \-e ", " \-f ", " \-j
|
||||
.BR \-b ", " \-e ", " \-f ", " \-j
|
||||
Ignored, for compatibility with Pico.
|
||||
|
||||
.SH TOGGLES
|
||||
|
@ -246,6 +246,11 @@ should be considered as parts of words. This overrides option
|
||||
Specify the syntax to be used for highlighting.
|
||||
@xref{Syntax Highlighting} for more info.
|
||||
|
||||
@item -a
|
||||
@itemx --atblanks
|
||||
When doing soft line wrapping, wrap lines at whitespace
|
||||
instead of always at the edge of the screen.
|
||||
|
||||
@item -c
|
||||
@itemx --constantshow
|
||||
Constantly display the cursor position (line number, column number,
|
||||
@ -375,8 +380,7 @@ continuing it over multiple screen lines. Since
|
||||
this option last when using other options (e.g.@: @code{nano -wS$}) or pass it
|
||||
separately (e.g.@: @code{nano -wS -$}).
|
||||
|
||||
@item -a
|
||||
@itemx -b
|
||||
@item -b
|
||||
@itemx -e
|
||||
@itemx -f
|
||||
@itemx -j
|
||||
|
10
src/nano.c
10
src/nano.c
@ -850,6 +850,9 @@ void usage(void)
|
||||
if (!ISSET(RESTRICTED))
|
||||
print_opt(_("-Y <name>"), _("--syntax=<name>"),
|
||||
N_("Syntax definition to use for coloring"));
|
||||
#endif
|
||||
#ifndef NANO_TINY
|
||||
print_opt("-a", "--atblanks", N_("When soft-wrapping, do it at whitespace"));
|
||||
#endif
|
||||
print_opt("-c", "--constantshow", N_("Constantly show cursor position"));
|
||||
print_opt("-d", "--rebinddelete",
|
||||
@ -1972,6 +1975,7 @@ int main(int argc, char **argv)
|
||||
{"smooth", 0, NULL, 'S'},
|
||||
{"wordbounds", 0, NULL, 'W'},
|
||||
{"wordchars", 1, NULL, 'X'},
|
||||
{"atblanks", 0, NULL, 'a'},
|
||||
{"autoindent", 0, NULL, 'i'},
|
||||
{"cut", 0, NULL, 'k'},
|
||||
{"unix", 0, NULL, 'u'},
|
||||
@ -2024,7 +2028,6 @@ int main(int argc, char **argv)
|
||||
"ABC:DEFGHIKLNOPQ:RST:UVWX:Y:abcdefghijklmno:pqr:s:tuvwxz$",
|
||||
long_options, NULL)) != -1) {
|
||||
switch (optchr) {
|
||||
case 'a':
|
||||
case 'b':
|
||||
case 'e':
|
||||
case 'f':
|
||||
@ -2127,6 +2130,11 @@ int main(int argc, char **argv)
|
||||
case 'Y':
|
||||
syntaxstr = mallocstrcpy(syntaxstr, optarg);
|
||||
break;
|
||||
#endif
|
||||
#ifndef NANO_TINY
|
||||
case 'a':
|
||||
SET(AT_BLANKS);
|
||||
break;
|
||||
#endif
|
||||
case 'c':
|
||||
SET(CONSTANT_SHOW);
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user