aboutsummaryrefslogtreecommitdiff
path: root/src/_usage.h
blob: 6f48cf8a56453e47702092d665ec3d3b63756861 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * @file _usage.h
 * @brief standardize help/usage output across all our programs
 * @internal
 *
 * Copyright 2007 Gentoo Foundation
 * Released under the GPLv2
 */

#define getoptstring_COMMON "Chq"
#define longopts_COMMON \
	{ "help",           0, NULL, 'h'}, \
	{ "nocolor",        0, NULL, 'C'}, \
	{ "quiet",			0, NULL, 'q'},

#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);