openrc/src/_usage.c

24 lines
508 B
C
Raw Normal View History

/*!
2007-04-17 18:14:32 +05:30
* @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;
2007-09-21 17:22:37 +05:30
printf ("Usage: " APPLET " [options] ");
#ifdef extraopts
printf (extraopts);
#endif
printf ("\n\nOptions: [" getoptstring "]\n");
2007-04-17 18:14:32 +05:30
for (i = 0; longopts[i].name; ++i)
printf (" -%c, --%-15s %s\n", longopts[i].val, longopts[i].name,
longopts_help[i]);
2007-04-17 18:14:32 +05:30
exit (exit_status);
}