From afaa27fd652fbc3555faa92f3e1e16957bafd751 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Thu, 28 Jun 2007 15:44:38 +0000 Subject: Add --nocolor to more programs --- src/_usage.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/_usage.h (limited to 'src') 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); -- cgit v1.2.3