[ostree] Make ostree admin --help output more useful



commit a0449ed246d68251c1058663731020b31955cb2d
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Sep 30 12:18:50 2012 -0400

    Make ostree admin --help output more useful
    
    At a minimum, it should list the available subcommands. This is
    still not perfect, since there is no way to get at the help output
    of the subcommands - getting that right needs more refactoring.
    
    Signed-off-by: Colin Walters <walters verbum org>

 src/libgsystem                |    2 +-
 src/ostree/ot-builtin-admin.c |   14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/src/libgsystem b/src/libgsystem
index c6b949b..9f0342c 160000
--- a/src/libgsystem
+++ b/src/libgsystem
@@ -1 +1 @@
-Subproject commit c6b949b3ddd1c214db15a31ccdbdff70aa01fa26
+Subproject commit 9f0342c586f8084991ccd7b888dba720bc929be8
diff --git a/src/ostree/ot-builtin-admin.c b/src/ostree/ot-builtin-admin.c
index 54f2829..000e091 100644
--- a/src/ostree/ot-builtin-admin.c
+++ b/src/ostree/ot-builtin-admin.c
@@ -63,6 +63,20 @@ ostree_builtin_admin (int argc, char **argv, GFile *repo_path, GError **error)
   ot_lobj GFile *ostree_dir = NULL;
 
   context = g_option_context_new ("[OPTIONS] SUBCOMMAND - Run an administrative subcommand");
+
+  {
+    GString *s = g_string_new ("Subcommands:\n");
+
+    subcommand = admin_subcommands;
+    while (subcommand->name)
+      {
+        g_string_append_printf (s, "  %s\n", subcommand->name);
+        subcommand++;
+      }
+    g_option_context_set_description (context, s->str);
+    g_string_free (s, TRUE);
+  }
+    
   g_option_context_add_main_entries (context, options, NULL);
   /* Skip subcommand options */
   g_option_context_set_ignore_unknown_options (context, TRUE);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]