aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-06-28 15:44:38 +0000
committerRoy Marples <roy@marples.name>2007-06-28 15:44:38 +0000
commitafaa27fd652fbc3555faa92f3e1e16957bafd751 (patch)
tree1223c02d70f8c057a64277c4b1ba4a6f8302bb49 /src
parent0fdc53d54db27853e87b2d85b8255ebc2d562263 (diff)
Add --nocolor to more programs
Diffstat (limited to 'src')
-rw-r--r--src/_usage.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/_usage.h b/src/_usage.h
new file mode 100644
index 00000000..56ea8f6e
--- /dev/null
+++ b/src/_usage.h
@@ -0,0 +1,18 @@
+/*
+ * @file _usage.h
+ * @brief standardize help/usage output across all our programs
+ * @internal
+ *
+ * Copyright 2007 Gentoo Foundation
+ * Released under the GPLv2
+ */
+
+#define getoptstring_COMMON "Ch"
+#define longopts_COMMON \
+ { "help", 0, NULL, 'h'}, \
+ { "nocolor", 0, NULL, 'C'},
+
+#define case_RC_COMMON_GETOPT \
+ case 'C': setenv ("RC_NOCOLOR", "yes", 1); break; \
+ case 'h': usage (EXIT_SUCCESS); \
+ default: usage (EXIT_FAILURE);