commit 84635cd8e8e8b33b4545eb98de3bd384c540a343
parent 03987abebd247dc7912d24f47f5dbfef96ec7a66
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Fri, 17 Jun 2005 22:53:41 +0000
change the short option for --restricted from -Z to -R
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2717 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
4 files changed, 25 insertions(+), 23 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -51,8 +51,10 @@ CVS code -
allows the prepend and append toggles at the search prompt.
For consistency, rename TOGGLE_REGEXP_KEY to NANO_REGEXP_KEY,
and move it out of the toggles block to where NANO_PREPEND_KEY
- and NANO_APPEND_KEY are. Changes to shortcut_init(), usage(),
- main(), search_init(), nano.1, nano.texi, etc. (DLR)
+ and NANO_APPEND_KEY are. Also, change the short command line
+ option for --restricted from -Z to -R. Changes to
+ shortcut_init(), usage(), main(), search_init(), nano.1,
+ nano.texi, etc. (DLR)
- Various cleanups and improvements in chars.c. Remove some
unnecessary w?ctype wrappers; change the wctype wrappers to
take wint_t instead of wchar_t to match the functions they
diff --git a/doc/man/nano.1 b/doc/man/nano.1
@@ -79,6 +79,13 @@ Set the quoting string for justifying. The default is
"^([\ \\t]*[|>:}#])+" if regular expression support is available, or
">\ " otherwise.
.TP
+.B \-R (\-\-restricted)
+Restricted mode: Don't read or write to any file not specified on the
+command line, read any nanorc files, allow suspending, or allow a file
+to be appended to, prepended to, or saved under a different name if it
+already has one. Also accessible by invoking \fBnano\fP with any name
+beginning with 'r' (e.g. "rnano").
+.TP
.B \-S (\-\-smooth)
Enable smooth scrolling. Text will scroll line-by-line, instead of the
usual chunk-by-chunk behavior.
@@ -97,13 +104,6 @@ Show the current version number and author.
Specify a specific syntax highlighting from the \fInanorc\fP to use, if
available.
.TP
-.B \-Z (\-\-restricted)
-Restricted mode: Don't read or write to any file not specified on the
-command line, read any nanorc files, allow suspending, or allow a file
-to be appended to, prepended to, or saved under a different name if it
-already has one. Also accessible by invoking \fBnano\fP with any name
-beginning with 'r' (e.g. "rnano").
-.TP
.B \-c (\-\-const)
Constantly show the cursor position. Note that this cancels out
\fB-U\fP.
diff --git a/doc/texinfo/nano.texi b/doc/texinfo/nano.texi
@@ -151,6 +151,13 @@ Set the quoting string for justifying. The default is
if regular expression support is available, or ``> '' otherwise. Note
that @code{\t} above stands for a literal Tab character.
+@item -R, --restricted
+Restricted mode: Don't read or write to any file not specified on the
+command line, read any nanorc files, allow suspending, or allow a file
+to be appended to, prepended to, or saved under a different name if it
+already has one. Also accessible by invoking @code{nano} with any name
+beginning with 'r' (e.g. "rnano").
+
@item -S, --smooth
Enable smooth scrolling.
@@ -168,13 +175,6 @@ Print the version number and copyright and quit.
Specify a specific syntax highlighting from the .nanorc to use, if
available.
-@item -Z, --restricted
-Restricted mode: Don't read or write to any file not specified on the
-command line, read any nanorc files, allow suspending, or allow a file
-to be appended to, prepended to, or saved under a different name if it
-already has one. Also accessible by invoking @code{nano} with any name
-beginning with 'r' (e.g. "rnano").
-
@item -c, --const
Constantly display the cursor position and line number on the statusbar.
Note that this cancels out -U.
diff --git a/src/nano.c b/src/nano.c
@@ -1051,6 +1051,7 @@ void usage(void)
print1opt(_("-Q [str]"), _("--quotestr=[str]"),
N_("Quoting string"));
#endif
+ print1opt("-R", "--restricted", N_("Restricted mode"));
#ifndef NANO_SMALL
print1opt("-S", "--smooth", N_("Smooth scrolling"));
#endif
@@ -1066,7 +1067,6 @@ void usage(void)
print1opt(_("-Y [str]"), _("--syntax=[str]"),
N_("Syntax definition to use"));
#endif
- print1opt("-Z", "--restricted", N_("Restricted mode"));
print1opt("-c", "--const", N_("Constantly show cursor position"));
print1opt("-d", "--rebinddelete",
N_("Fix Backspace/Delete confusion problem"));
@@ -4119,12 +4119,12 @@ int main(int argc, char **argv)
#ifndef DISABLE_JUSTIFY
{"quotestr", 1, NULL, 'Q'},
#endif
+ {"restricted", 0, NULL, 'R'},
{"tabsize", 1, NULL, 'T'},
{"version", 0, NULL, 'V'},
#ifdef ENABLE_COLOR
{"syntax", 1, NULL, 'Y'},
#endif
- {"restricted", 0, NULL, 'Z'},
{"const", 0, NULL, 'c'},
{"rebinddelete", 0, NULL, 'd'},
{"nofollow", 0, NULL, 'l'},
@@ -4197,11 +4197,11 @@ int main(int argc, char **argv)
while ((optchr =
#ifdef HAVE_GETOPT_LONG
getopt_long(argc, argv,
- "h?ABC:EFHINOQ:ST:UVY:Zabcdefgijklmo:pr:s:tvwxz",
+ "h?ABC:EFHINOQ:RST:UVY:abcdefgijklmo:pr:s:tvwxz",
long_options, NULL)
#else
getopt(argc, argv,
- "h?ABC:EFHINOQ:ST:UVY:Zabcdefgijklmo:pr:s:tvwxz")
+ "h?ABC:EFHINOQ:RST:UVY:abcdefgijklmo:pr:s:tvwxz")
#endif
) != -1) {
@@ -4256,6 +4256,9 @@ int main(int argc, char **argv)
quotestr = mallocstrcpy(quotestr, optarg);
break;
#endif
+ case 'R':
+ SET(RESTRICTED);
+ break;
#ifndef NANO_SMALL
case 'S':
SET(SMOOTH_SCROLL);
@@ -4281,9 +4284,6 @@ int main(int argc, char **argv)
syntaxstr = mallocstrcpy(syntaxstr, optarg);
break;
#endif
- case 'Z':
- SET(RESTRICTED);
- break;
case 'c':
SET(CONST_UPDATE);
break;