summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2008-07-01 11:20:44 -0400
committerRay Strode <rstrode@redhat.com>2008-07-01 11:20:44 -0400
commit09378c11a511f8a15b5085ece4f36056ad28a277 (patch)
treeec185ccebfc786d7724badd3c3f1f5ce6d4ed7e1
parent82922539c659c48ff68c41ac17c229d9d43718a4 (diff)
downloadplymouth-09378c11a511f8a15b5085ece4f36056ad28a277.tar.gz
plymouth-09378c11a511f8a15b5085ece4f36056ad28a277.tar.xz
plymouth-09378c11a511f8a15b5085ece4f36056ad28a277.zip
Drop print_usage function
It was hard coded, and we generate help dynamically now.
-rw-r--r--src/client/plymouth.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/client/plymouth.c b/src/client/plymouth.c
index cd9f47b..ece2ea6 100644
--- a/src/client/plymouth.c
+++ b/src/client/plymouth.c
@@ -65,13 +65,6 @@ on_disconnect (state_t *state)
ply_event_loop_exit (state->loop, 2);
}
-void
-print_usage (void)
-{
- ply_log ("plymouth [--ping] [--update=STATUS] [--show-splash] [--details] [--newroot=<directory>] [--sysinit] [--quit]");
- ply_flush_log ();
-}
-
int
main (int argc,
char **argv)
@@ -83,12 +76,6 @@ main (int argc,
exit_code = 0;
- if (argc <= 1)
- {
- print_usage ();
- return 1;
- }
-
state.loop = ply_event_loop_new ();
state.client = ply_boot_client_new ();
state.command_parser = ply_command_parser_new ("plymouth", "Boot splash control client");
@@ -129,13 +116,16 @@ main (int argc,
"update", &status,
NULL);
- if (should_help)
+ if (should_help || argc < 2)
{
char *help_string;
help_string = ply_command_parser_get_help_string (state.command_parser);
- printf ("%s", help_string);
+ if (argc < 2)
+ fprintf (stderr, "%s", help_string);
+ else
+ printf ("%s", help_string);
free (help_string);
return 0;