Commit cb56a575 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

options: recognize -M and --trimblanks on the command line

parent a429dc4a
Showing with 15 additions and 1 deletion
+15 -1
...@@ -108,6 +108,10 @@ won't work properly with this option enabled. ...@@ -108,6 +108,10 @@ won't work properly with this option enabled.
.BR \-L ", " \-\-nonewlines .BR \-L ", " \-\-nonewlines
Don't add newlines to the ends of files. Don't add newlines to the ends of files.
.TP .TP
.BR \-M ", " \-\-trimblanks
Snip trailing whitespace from the wrapped line when automatic
hard-wrapping occurs or when text is justified.
.TP
.BR \-N ", " \-\-noconvert .BR \-N ", " \-\-noconvert
Disable automatic conversion of files from DOS/Mac format. Disable automatic conversion of files from DOS/Mac format.
.TP .TP
......
...@@ -200,6 +200,11 @@ won't work properly with this option enabled. ...@@ -200,6 +200,11 @@ won't work properly with this option enabled.
@itemx --nonewlines @itemx --nonewlines
Don't add newlines to the ends of files. Don't add newlines to the ends of files.
@item -M
@itemx --trimblanks
Snip trailing whitespace from the wrapped line when automatic
hard-wrapping occurs or when text is justified.
@item -N @item -N
@itemx --noconvert @itemx --noconvert
Disable automatic conversion of files from DOS/Mac format. Disable automatic conversion of files from DOS/Mac format.
......
...@@ -818,6 +818,8 @@ void usage(void) ...@@ -818,6 +818,8 @@ void usage(void)
N_("Fix numeric keypad key confusion problem")); N_("Fix numeric keypad key confusion problem"));
print_opt("-L", "--nonewlines", print_opt("-L", "--nonewlines",
N_("Don't add newlines to the ends of files")); N_("Don't add newlines to the ends of files"));
print_opt("-M", "--trimblanks",
N_("Trim tail spaces when hard-wrapping"));
#ifndef NANO_TINY #ifndef NANO_TINY
print_opt("-N", "--noconvert", print_opt("-N", "--noconvert",
N_("Don't convert files from DOS/Mac format")); N_("Don't convert files from DOS/Mac format"));
...@@ -2031,7 +2033,7 @@ int main(int argc, char **argv) ...@@ -2031,7 +2033,7 @@ int main(int argc, char **argv)
while ((optchr = while ((optchr =
getopt_long(argc, argv, getopt_long(argc, argv,
"ABC:DEFGHIKLNOPQ:RST:UVWX:Y:abcdefghijklmno:pqr:s:tuvwxz$", "ABC:DEFGHIKLMNOPQ:RST:UVWX:Y:abcdefghijklmno:pqr:s:tuvwxz$",
long_options, NULL)) != -1) { long_options, NULL)) != -1) {
switch (optchr) { switch (optchr) {
case 'b': case 'b':
...@@ -2085,6 +2087,9 @@ int main(int argc, char **argv) ...@@ -2085,6 +2087,9 @@ int main(int argc, char **argv)
case 'L': case 'L':
SET(NO_NEWLINES); SET(NO_NEWLINES);
break; break;
case 'M':
SET(TRIM_BLANKS);
break;
#ifndef NANO_TINY #ifndef NANO_TINY
case 'N': case 'N':
SET(NO_CONVERT); SET(NO_CONVERT);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment