From 8e476f9d0c6d6c48ac80e4f6e9cb552492fdfb0b Mon Sep 17 00:00:00 2001 From: Tomas Mlcoch Date: Mon, 3 Mar 2014 09:42:10 +0100 Subject: [PATCH] Fix usage strings in help. --- src/cmd_parser.c | 6 +++--- src/mergerepo_c.c | 7 ++++--- src/modifyrepo_c.c | 5 ++++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/cmd_parser.c b/src/cmd_parser.c index 867fc3a..e5c0705 100644 --- a/src/cmd_parser.c +++ b/src/cmd_parser.c @@ -152,9 +152,9 @@ struct CmdOptions *parse_arguments(int *argc, char ***argv, GError **err) assert(!err || *err == NULL); - context = g_option_context_new("- program that creates a repomd (xml-based" - " rpm metadata) repository from a set of" - " rpms."); + context = g_option_context_new(""); + g_option_context_set_summary(context, "Program that creates a repomd " + "(xml-based rpm metadata) repository from a set of rpms."); g_option_context_add_main_entries(context, cmd_entries, NULL); group_expert = g_option_group_new("expert", diff --git a/src/mergerepo_c.c b/src/mergerepo_c.c index 3139a89..59a990f 100644 --- a/src/mergerepo_c.c +++ b/src/mergerepo_c.c @@ -378,8 +378,9 @@ parse_arguments(int *argc, char ***argv) GError *error = NULL; GOptionContext *context; - context = g_option_context_new(": take 2 or more repositories and merge " - "their metadata into a new repo"); + context = g_option_context_new("--repo=url --repo=url"); + g_option_context_set_summary(context, "Take 2 or more repositories and " + "merge their metadata into a new repo"); g_option_context_add_main_entries(context, cmd_entries, NULL); gboolean ret = g_option_context_parse(context, argc, argv, &error); @@ -1547,7 +1548,7 @@ main(int argc, char **argv) if (g_slist_length(cmd_options->repo_list) < 2) { free_options(cmd_options); - fprintf(stderr, "Usage: %s [options]\n\n" + fprintf(stderr, "Usage: %s [OPTION...] --repo=url --repo=url\n\n" "%s: take 2 or more repositories and merge their " "metadata into a new repo\n\n", cr_get_filename(argv[0]), cr_get_filename(argv[0])); diff --git a/src/modifyrepo_c.c b/src/modifyrepo_c.c index 7e8c384..467b277 100644 --- a/src/modifyrepo_c.c +++ b/src/modifyrepo_c.c @@ -108,7 +108,10 @@ parse_arguments(int *argc, char ***argv, RawCmdOptions *options, GError **err) options->new_name = NULL; GOptionContext *context; - context = g_option_context_new(": Modify a repository's repomd.xml"); + context = g_option_context_new(" \n" + " modifyrepo_c --remove \n" + " modifyrepo_c [OPTION...] --batchfile "); + g_option_context_set_summary(context, "Modify a repository's repomd.xml"); g_option_context_add_main_entries(context, cmd_entries, NULL); gboolean ret = g_option_context_parse(context, argc, argv, err); g_option_context_free(context); -- 2.7.4