From: Colin Walters Date: Thu, 24 Aug 2023 01:22:49 +0000 (-0400) Subject: cmd/show-remote-url: Port to C99 style X-Git-Tag: archive/raspbian/2023.7-3+rpi1^2~16^2^2~42^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=cce1814c50d1062001df6c51e0fde454e7109b95;p=ostree.git cmd/show-remote-url: Port to C99 style Just keeping up momentum. --- diff --git a/src/ostree/ot-remote-builtin-show-url.c b/src/ostree/ot-remote-builtin-show-url.c index f8316536..0ce7ee35 100644 --- a/src/ostree/ot-remote-builtin-show-url.c +++ b/src/ostree/ot-remote-builtin-show-url.c @@ -35,32 +35,24 @@ gboolean ot_remote_builtin_show_url (int argc, char **argv, OstreeCommandInvocation *invocation, GCancellable *cancellable, GError **error) { - g_autoptr (GOptionContext) context = NULL; + g_autoptr (GOptionContext) context = g_option_context_new ("NAME"); g_autoptr (OstreeRepo) repo = NULL; - const char *remote_name; - g_autofree char *remote_url = NULL; - gboolean ret = FALSE; - - context = g_option_context_new ("NAME"); - if (!ostree_option_context_parse (context, option_entries, &argc, &argv, invocation, &repo, cancellable, error)) - goto out; + return FALSE; if (argc < 2) { ot_util_usage_error (context, "NAME must be specified", error); - goto out; + return FALSE; } - remote_name = argv[1]; + const char *remote_name = argv[1]; - if (ostree_repo_remote_get_url (repo, remote_name, &remote_url, error)) - { - g_print ("%s\n", remote_url); - ret = TRUE; - } + g_autofree char *remote_url = NULL; + if (!ostree_repo_remote_get_url (repo, remote_name, &remote_url, error)) + return FALSE; -out: - return ret; + g_print ("%s\n", remote_url); + return TRUE; }