diff options
Diffstat (limited to 'src/ostree/ot-remote-builtin-delete.c')
-rw-r--r-- | src/ostree/ot-remote-builtin-delete.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/ostree/ot-remote-builtin-delete.c b/src/ostree/ot-remote-builtin-delete.c index eb60783c..e5e310f3 100644 --- a/src/ostree/ot-remote-builtin-delete.c +++ b/src/ostree/ot-remote-builtin-delete.c @@ -33,27 +33,29 @@ static char *opt_repo; * man page (man/ostree-remote.xml) when changing the option list. */ -static GOptionEntry option_entries[] = { - { "if-exists", 0, 0, G_OPTION_ARG_NONE, &opt_if_exists, "Do nothing if the provided remote does not exist", NULL }, - { "repo", 0, 0, G_OPTION_ARG_FILENAME, &opt_repo, "Path to OSTree repository (defaults to /sysroot/ostree/repo)", "PATH" }, - { "sysroot", 0, 0, G_OPTION_ARG_FILENAME, &opt_sysroot, "Use sysroot at PATH (overrides --repo)", "PATH" }, - { NULL } -}; +static GOptionEntry option_entries[] + = { { "if-exists", 0, 0, G_OPTION_ARG_NONE, &opt_if_exists, + "Do nothing if the provided remote does not exist", NULL }, + { "repo", 0, 0, G_OPTION_ARG_FILENAME, &opt_repo, + "Path to OSTree repository (defaults to /sysroot/ostree/repo)", "PATH" }, + { "sysroot", 0, 0, G_OPTION_ARG_FILENAME, &opt_sysroot, + "Use sysroot at PATH (overrides --repo)", "PATH" }, + { NULL } }; gboolean -ot_remote_builtin_delete (int argc, char **argv, OstreeCommandInvocation *invocation, GCancellable *cancellable, GError **error) +ot_remote_builtin_delete (int argc, char **argv, OstreeCommandInvocation *invocation, + GCancellable *cancellable, GError **error) { - g_autoptr(GOptionContext) context = g_option_context_new ("NAME"); + g_autoptr (GOptionContext) context = g_option_context_new ("NAME"); - if (!ostree_option_context_parse (context, option_entries, &argc, &argv, - invocation, NULL, cancellable, error)) + if (!ostree_option_context_parse (context, option_entries, &argc, &argv, invocation, NULL, + cancellable, error)) return FALSE; - g_autoptr(OstreeSysroot) sysroot = NULL; - g_autoptr(OstreeRepo) repo = NULL; - if (!ostree_parse_sysroot_or_repo_option (context, opt_sysroot, opt_repo, - &sysroot, &repo, + g_autoptr (OstreeSysroot) sysroot = NULL; + g_autoptr (OstreeRepo) repo = NULL; + if (!ostree_parse_sysroot_or_repo_option (context, opt_sysroot, opt_repo, &sysroot, &repo, cancellable, error)) return FALSE; @@ -66,10 +68,9 @@ ot_remote_builtin_delete (int argc, char **argv, OstreeCommandInvocation *invoca const char *remote_name = argv[1]; if (!ostree_repo_remote_change (repo, NULL, - opt_if_exists ? OSTREE_REPO_REMOTE_CHANGE_DELETE_IF_EXISTS : - OSTREE_REPO_REMOTE_CHANGE_DELETE, - remote_name, NULL, NULL, - cancellable, error)) + opt_if_exists ? OSTREE_REPO_REMOTE_CHANGE_DELETE_IF_EXISTS + : OSTREE_REPO_REMOTE_CHANGE_DELETE, + remote_name, NULL, NULL, cancellable, error)) return FALSE; return TRUE; |