git.annexia.org
/
febootstrap.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Send usage output to stdout or stderr depending on context.
[febootstrap.git]
/
helper
/
main.c
diff --git
a/helper/main.c
b/helper/main.c
index
4afcb24
..
f194008
100644
(file)
--- a/
helper/main.c
+++ b/
helper/main.c
@@
-51,9
+51,10
@@
static const struct option long_options[] = {
};
static void
};
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"
"\n"
"Usage:\n"
" %s [-options] inputs [...] host_cpu kernel initrd\n"
@@
-99,7
+100,7
@@
main (int argc, char *argv[])
switch (c) {
case HELP_OPTION:
switch (c) {
case HELP_OPTION:
- usage (argv[0]);
+ usage (
stdout,
argv[0]);
exit (EXIT_SUCCESS);
case 'f':
exit (EXIT_SUCCESS);
case 'f':
@@
-119,7
+120,7
@@
main (int argc, char *argv[])
exit (EXIT_SUCCESS);
default:
exit (EXIT_SUCCESS);
default:
- usage (argv[0]);
+ usage (
stderr,
argv[0]);
exit (EXIT_FAILURE);
}
}
exit (EXIT_FAILURE);
}
}