[augeas-devel] [PATCH] Add short options for --nostdinc, --noload and --noautoload in augtool Update pod and manpage accordingly
raphink at gmail.com
raphink at gmail.com
Mon Feb 21 21:27:54 UTC 2011
From: Raphaël Pinson <raphink at gmail.com>
---
man/augtool.1 | 16 ++++++++--------
man/augtool.pod | 6 +++---
src/augtool.c | 23 ++++++++++-------------
3 files changed, 21 insertions(+), 24 deletions(-)
diff --git a/man/augtool.1 b/man/augtool.1
index 831f028..62884d4 100644
--- a/man/augtool.1
+++ b/man/augtool.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
+.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -124,7 +124,7 @@
.\" ========================================================================
.\"
.IX Title "AUGTOOL 1"
-.TH AUGTOOL 1 "2011-02-14" "Augeas 0.7.4" "Augeas"
+.TH AUGTOOL 1 "2011-02-21" "Augeas 0.8.0" "Augeas"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -184,18 +184,18 @@ printing their output.
.IP "\fB\-s\fR, \fB\-\-autosave\fR" 4
.IX Item "-s, --autosave"
Automatically save all changes at the end of the session.
-.IP "\fB\-\-nostdinc\fR" 4
-.IX Item "--nostdinc"
+.IP "\fB\-S\fR, \fB\-\-nostdinc\fR" 4
+.IX Item "-S, --nostdinc"
Do not search any of the default directories for modules. When this option
is set, only directories specified explicitly with \fB\-I\fR or specified in
\&\fB\s-1AUGEAS_LENS_LIB\s0\fR will be searched for modules.
-.IP "\fB\-\-noload\fR" 4
-.IX Item "--noload"
+.IP "\fB\-L\fR, \fB\-\-noload\fR" 4
+.IX Item "-L, --noload"
Do not load any files on startup. This is generally used to fine-tune which
files to load by modifying the entries in \f(CW\*(C`/augeas/load\*(C'\fR and then issuing
a \f(CW\*(C`load\*(C'\fR command.
-.IP "\fB\-\-noautoload\fR" 4
-.IX Item "--noautoload"
+.IP "\fB\-A\fR, \fB\-\-noautoload\fR" 4
+.IX Item "-A, --noautoload"
Do not load any lens modules, and therefore no files, on startup. This
creates no entries under \f(CW\*(C`/augeas/load\*(C'\fR whatsoever; to read any files,
they need to be set up manually and loading must be initiated with a
diff --git a/man/augtool.pod b/man/augtool.pod
index 79cf7e6..5fbb873 100644
--- a/man/augtool.pod
+++ b/man/augtool.pod
@@ -68,19 +68,19 @@ printing their output.
Automatically save all changes at the end of the session.
-=item B<--nostdinc>
+=item B<-S>, B<--nostdinc>
Do not search any of the default directories for modules. When this option
is set, only directories specified explicitly with B<-I> or specified in
B<AUGEAS_LENS_LIB> will be searched for modules.
-=item B<--noload>
+=item B<-L>, B<--noload>
Do not load any files on startup. This is generally used to fine-tune which
files to load by modifying the entries in C</augeas/load> and then issuing
a C<load> command.
-=item B<--noautoload>
+=item B<-A>, B<--noautoload>
Do not load any lens modules, and therefore no files, on startup. This
creates no entries under C</augeas/load> whatsoever; to read any files,
diff --git a/src/augtool.c b/src/augtool.c
index fbb4a05..7720b92 100644
--- a/src/augtool.c
+++ b/src/augtool.c
@@ -1034,9 +1034,9 @@ static void usage(void) {
fprintf(stderr, " -f, --file FILE read commands from FILE\n");
fprintf(stderr, " -s, --autosave automatically save at the end of instructions\n");
fprintf(stderr, " -i, --interactive run an interactive shell after evaluating the commands in STDIN and FILE\n");
- fprintf(stderr, " --nostdinc do not search the builtin default directories for modules\n");
- fprintf(stderr, " --noload do not load any files into the tree on startup\n");
- fprintf(stderr, " --noautoload do not autoload modules from the search path\n");
+ fprintf(stderr, " -S, --nostdinc do not search the builtin default directories for modules\n");
+ fprintf(stderr, " -L, --noload do not load any files into the tree on startup\n");
+ fprintf(stderr, " -A, --noautoload do not autoload modules from the search path\n");
fprintf(stderr, " --version print version information and exit.\n");
exit(EXIT_FAILURE);
@@ -1046,10 +1046,7 @@ static void parse_opts(int argc, char **argv) {
int opt;
size_t loadpathlen = 0;
enum {
- VAL_NO_STDINC = CHAR_MAX + 1,
- VAL_NO_LOAD = VAL_NO_STDINC + 1,
- VAL_NO_AUTOLOAD = VAL_NO_LOAD + 1,
- VAL_VERSION = VAL_NO_AUTOLOAD + 1
+ VAL_VERSION = CHAR_MAX + 1
};
struct option options[] = {
{ "help", 0, 0, 'h' },
@@ -1062,9 +1059,9 @@ static void parse_opts(int argc, char **argv) {
{ "file", 1, 0, 'f' },
{ "autosave", 0, 0, 's' },
{ "interactive", 0, 0, 'i' },
- { "nostdinc", 0, 0, VAL_NO_STDINC },
- { "noload", 0, 0, VAL_NO_LOAD },
- { "noautoload", 0, 0, VAL_NO_AUTOLOAD },
+ { "nostdinc", 0, 0, 'S' },
+ { "noload", 0, 0, 'L' },
+ { "noautoload", 0, 0, 'A' },
{ "version", 0, 0, VAL_VERSION },
{ 0, 0, 0, 0}
};
@@ -1102,13 +1099,13 @@ static void parse_opts(int argc, char **argv) {
case 'i':
interactive = true;
break;
- case VAL_NO_STDINC:
+ case 'S':
flags |= AUG_NO_STDINC;
break;
- case VAL_NO_LOAD:
+ case 'L':
flags |= AUG_NO_LOAD;
break;
- case VAL_NO_AUTOLOAD:
+ case 'A':
flags |= AUG_NO_MODL_AUTOLOAD;
break;
case VAL_VERSION:
--
1.7.1
More information about the augeas-devel
mailing list