aboutsummaryrefslogtreecommitdiff
path: root/src/_usage.h
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-09-25 23:17:25 +0000
committerMike Frysinger <vapier@gentoo.org>2007-09-25 23:17:25 +0000
commitab0edd43b9c6df2946e8a514b12e04db23f13c65 (patch)
tree8a8d9658c9d0671fb55df28f9f00f323473b8417 /src/_usage.h
parent7d9acd968f7a0537b258f23edaca2c85a0774b47 (diff)
unify verbose/quiet handling
Diffstat (limited to 'src/_usage.h')
-rw-r--r--src/_usage.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/_usage.h b/src/_usage.h
index 83b4f999..cff60df5 100644
--- a/src/_usage.h
+++ b/src/_usage.h
@@ -12,15 +12,24 @@
#define longopts_COMMON \
{ "help", 0, NULL, 'h'}, \
{ "nocolor", 0, NULL, 'C'}, \
+ { "verbose", 0, NULL, 'v'}, \
{ "quiet", 0, NULL, 'q'},
#define longopts_help_COMMON \
"Display this help output (duh)", \
"Disable color output", \
+ "Run verbosely", \
"Run quietly"
+#define case_RC_COMMON_getopt_case_C setenv ("RC_NOCOLOR", "yes", 1);
+#define case_RC_COMMON_getopt_case_h usage (EXIT_SUCCESS);
+#define case_RC_COMMON_getopt_case_v setenv ("RC_VERBOSE", "yes", 1);
+#define case_RC_COMMON_getopt_case_q setenv ("RC_QUIET", "yes", 1);
+#define case_RC_COMMON_getopt_default usage (EXIT_FAILURE);
+
#define case_RC_COMMON_GETOPT \
- case 'C': setenv ("RC_NOCOLOR", "yes", 1); break; \
- case 'h': usage (EXIT_SUCCESS); \
- case 'q': setenv ("RC_QUIET", "yes", 1); break; \
- default: usage (EXIT_FAILURE);
+ case 'C': case_RC_COMMON_getopt_case_C; break; \
+ case 'h': case_RC_COMMON_getopt_case_h; break; \
+ case 'v': case_RC_COMMON_getopt_case_v; break; \
+ case 'q': case_RC_COMMON_getopt_case_q; break; \
+ default: case_RC_COMMON_getopt_default; break;