]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[client] add update subcommand
authorRay Strode <rstrode@redhat.com>
Wed, 24 Mar 2010 20:43:19 +0000 (16:43 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 24 Mar 2010 20:57:40 +0000 (16:57 -0400)
This is to replace the old style --update option.

src/client/plymouth.c

index c424b57b85d5636ccc57ff0668fc35bd42d0ebb6..f36a48a3653efa83bec8b4581c7fff221e5ca25f 100644 (file)
@@ -793,6 +793,29 @@ on_hide_splash_request (state_t    *state,
                                                on_failure, state);
 }
 
+static void
+on_update_request (state_t    *state,
+                   const char *command)
+{
+  char *status;
+
+  status = NULL;
+  ply_command_parser_get_command_options (state->command_parser,
+                                          command,
+                                          "status", &status,
+                                          NULL);
+
+  if (status != NULL)
+    {
+      ply_boot_client_update_daemon (state->client, status,
+                                     (ply_boot_client_response_handler_t)
+                                     on_success,
+                                     (ply_boot_client_response_handler_t)
+                                     on_failure, state);
+
+    }
+}
+
 int
 main (int    argc,
       char **argv)
@@ -829,6 +852,14 @@ main (int    argc,
                                   "wait", "Wait for boot daemon to quit", PLY_COMMAND_OPTION_TYPE_FLAG,
                                   NULL);
 
+  ply_command_parser_add_command (state.command_parser,
+                                  "update", "Tell daemon about boot status changes",
+                                  (ply_command_handler_t)
+                                  on_update_request, &state,
+                                  "status", "Tell daemon the current boot status",
+                                  PLY_COMMAND_OPTION_TYPE_STRING,
+                                  NULL);
+
   ply_command_parser_add_command (state.command_parser,
                                   "update-root-fs", "Tell daemon about root filesystem changes",
                                   (ply_command_handler_t)