diff options
author | Owen W. Taylor <otaylor@fishsoup.net> | 2014-09-25 02:34:30 -0400 |
---|---|---|
committer | Owen W. Taylor <otaylor@fishsoup.net> | 2014-09-25 14:28:58 -0400 |
commit | 3400f2d2aef70ae9abc319ddb73ed407befbe528 (patch) | |
tree | ec115e170825bab2dc5eac1c271c18762e28f9db /src/ostree/ot-builtin-admin.c | |
parent | c9018c785ca7296bf78ebabce5e10ef3094eee66 (diff) | |
download | ostree-3400f2d2aef70ae9abc319ddb73ed407befbe528.tar.gz |
--help should always go to stdout
The standard convention is that the output of --help should go to standard
output (so that it can be piped to a pager and searched.) See, e.g., the
GNU coding standards.
https://bugzilla.gnome.org/show_bug.cgi?id=737194
Diffstat (limited to 'src/ostree/ot-builtin-admin.c')
-rw-r--r-- | src/ostree/ot-builtin-admin.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ostree/ot-builtin-admin.c b/src/ostree/ot-builtin-admin.c index ef54797e..afc3bb33 100644 --- a/src/ostree/ot-builtin-admin.c +++ b/src/ostree/ot-builtin-admin.c @@ -147,12 +147,14 @@ ostree_builtin_admin (int argc, char **argv, OstreeRepo *repo, GCancellable *can if (subcommand_name == NULL) { + void (*print_func) (const gchar *format, ...) = want_help ? g_print : g_printerr; + subcommand = admin_subcommands; - g_print ("usage: ostree admin --sysroot=PATH COMMAND [options]\n"); - g_print ("Builtin commands:\n"); + print_func ("usage: ostree admin --sysroot=PATH COMMAND [options]\n"); + print_func ("Builtin commands:\n"); while (subcommand->name) { - g_print (" %s\n", subcommand->name); + print_func (" %s\n", subcommand->name); subcommand++; } |