If usage information is displayed because of an error, it should go to stderr.
If it is displayed because the -h option was given it should go to stdout.
};
static void
-usage (const char *progname)
+usage (FILE *f, const char *progname)
{
- printf ("%s: build the supermin appliance on the fly\n"
+ fprintf (f,
+ "%s: build the supermin appliance on the fly\n"
"\n"
"Usage:\n"
" %s [-options] inputs [...] host_cpu kernel initrd\n"
switch (c) {
case HELP_OPTION:
- usage (argv[0]);
+ usage (stdout, argv[0]);
exit (EXIT_SUCCESS);
case 'f':
exit (EXIT_SUCCESS);
default:
- usage (argv[0]);
+ usage (stderr, argv[0]);
exit (EXIT_FAILURE);
}
}