diff options
author | Colin Walters <walters@verbum.org> | 2017-11-15 18:04:31 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2017-11-15 23:31:26 +0000 |
commit | 23db56f9c36f4e2b16cc42f97fd9c7147bcf0d3d (patch) | |
tree | 1fe96f5b9848616f5f5d4a7e9aa5eaff2774a9a6 /src/ostree/ot-builtin-remote.c | |
parent | 20996d0da30377e029495c88120d2dc014976685 (diff) | |
download | ostree-23db56f9c36f4e2b16cc42f97fd9c7147bcf0d3d.tar.gz |
bin: Port a few commands (diff,remote,static-delta) to new style
No functional changes, not prep for anything, just keeping up some momentum.
Closes: #1344
Approved by: jlebon
Diffstat (limited to 'src/ostree/ot-builtin-remote.c')
-rw-r--r-- | src/ostree/ot-builtin-remote.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/ostree/ot-builtin-remote.c b/src/ostree/ot-builtin-remote.c index 0be878cc..dfb07d03 100644 --- a/src/ostree/ot-builtin-remote.c +++ b/src/ostree/ot-builtin-remote.c @@ -86,12 +86,8 @@ remote_option_context_new_with_commands (void) gboolean ostree_builtin_remote (int argc, char **argv, OstreeCommandInvocation *invocation, GCancellable *cancellable, GError **error) { - OstreeCommand *subcommand; const char *subcommand_name = NULL; - g_autofree char *prgname = NULL; - gboolean ret = FALSE; - int in, out; - + int in,out; for (in = 1, out = 1; in < argc; in++, out++) { /* The non-option is the command, take it out of the arguments */ @@ -115,7 +111,7 @@ ostree_builtin_remote (int argc, char **argv, OstreeCommandInvocation *invocatio argc = out; - subcommand = remote_subcommands; + OstreeCommand *subcommand = remote_subcommands; while (subcommand->name) { if (g_strcmp0 (subcommand_name, subcommand->name) == 0) @@ -150,18 +146,15 @@ ostree_builtin_remote (int argc, char **argv, OstreeCommandInvocation *invocatio help = g_option_context_get_help (context, FALSE, NULL); g_printerr ("%s", help); - goto out; + return FALSE; } - prgname = g_strdup_printf ("%s %s", g_get_prgname (), subcommand_name); + g_autofree char *prgname = g_strdup_printf ("%s %s", g_get_prgname (), subcommand_name); g_set_prgname (prgname); OstreeCommandInvocation sub_invocation = { .command = subcommand }; if (!subcommand->fn (argc, argv, &sub_invocation, cancellable, error)) - goto out; - - ret = TRUE; + return FALSE; - out: - return ret; + return TRUE; } |