summaryrefslogtreecommitdiff
path: root/src/ostree/ot-main.c
diff options
context:
space:
mode:
authorRuixin Bao <peter.bao@mail.utoronto.ca>2017-10-13 16:15:13 +0000
committerAtomic Bot <atomic-devel@projectatomic.io>2017-10-20 12:59:32 +0000
commit3c360a720ff1a8bf695365a79b3ac7975ffd25e8 (patch)
treef62cf412aebb3719e0760ba696e8a224e4bfe986 /src/ostree/ot-main.c
parent2531d8fe631b8484b5731f3635314ac3eb82eed5 (diff)
downloadostree-3c360a720ff1a8bf695365a79b3ac7975ffd25e8.tar.gz
ostree: Describe subcommands in help output
Added a description argument to all type of commands. Now when we include -h or --help for commands that contain subcommands, the description for those subcommands are shown. The added subcommands help will be provided to the following commands: - ostree -h - ostree admin -h - ostree admin instutil -h - ostree remote -h - ostree static-delta -h Closes: #1267 Approved by: cgwalters
Diffstat (limited to 'src/ostree/ot-main.c')
-rw-r--r--src/ostree/ot-main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ostree/ot-main.c b/src/ostree/ot-main.c
index 8e8c4631..d81b802c 100644
--- a/src/ostree/ot-main.c
+++ b/src/ostree/ot-main.c
@@ -64,7 +64,11 @@ ostree_option_context_new_with_commands (OstreeCommand *commands)
while (commands->name != NULL)
{
- g_string_append_printf (summary, "\n %s", commands->name);
+ g_string_append_printf (summary, "\n %-18s", commands->name);
+
+ if (commands->description != NULL )
+ g_string_append_printf (summary, "%s", commands->description);
+
commands++;
}