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

static void usage (int exit_status)
{
	int i;
	printf ("Usage: " APPLET " [options] ");
#ifdef extraopts
	printf (extraopts);
#endif
	printf ("\n\nOptions: [" getoptstring "]\n");
	for (i = 0; longopts[i].name; ++i)
		printf ("  -%c, --%-15s %s\n", longopts[i].val, longopts[i].name,
		        longopts_help[i]);
	exit (exit_status);
}