aboutsummaryrefslogtreecommitdiff
path: root/src/_usage.h
diff options
context:
space:
mode:
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;