diff --git a/src/ostree/ot-admin-builtin-cleanup.c b/src/ostree/ot-admin-builtin-cleanup.c index be9aaf32..8607c115 100644 --- a/src/ostree/ot-admin-builtin-cleanup.c +++ b/src/ostree/ot-admin-builtin-cleanup.c @@ -43,7 +43,9 @@ ot_admin_builtin_cleanup (int argc, char **argv, GCancellable *cancellable, GErr context = g_option_context_new ("Delete untagged deployments and repository objects"); - if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error)) + if (!ostree_admin_option_context_parse (context, options, &argc, &argv, + OSTREE_ADMIN_BUILTIN_FLAG_NONE, + &sysroot, cancellable, error)) goto out; if (!ostree_sysroot_load (sysroot, cancellable, error)) diff --git a/src/ostree/ot-admin-builtin-deploy.c b/src/ostree/ot-admin-builtin-deploy.c index 6c4327b7..6e6acfc5 100644 --- a/src/ostree/ot-admin-builtin-deploy.c +++ b/src/ostree/ot-admin-builtin-deploy.c @@ -66,7 +66,9 @@ ot_admin_builtin_deploy (int argc, char **argv, GCancellable *cancellable, GErro context = g_option_context_new ("REFSPEC - Checkout revision REFSPEC as the new default deployment"); - if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error)) + if (!ostree_admin_option_context_parse (context, options, &argc, &argv, + OSTREE_ADMIN_BUILTIN_FLAG_NONE, + &sysroot, cancellable, error)) goto out; if (argc < 2) diff --git a/src/ostree/ot-admin-builtin-diff.c b/src/ostree/ot-admin-builtin-diff.c index 55a89110..be225d9e 100644 --- a/src/ostree/ot-admin-builtin-diff.c +++ b/src/ostree/ot-admin-builtin-diff.c @@ -55,7 +55,9 @@ ot_admin_builtin_diff (int argc, char **argv, GCancellable *cancellable, GError g_option_context_add_main_entries (context, options, NULL); - if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error)) + if (!ostree_admin_option_context_parse (context, options, &argc, &argv, + OSTREE_ADMIN_BUILTIN_FLAG_NONE, + &sysroot, cancellable, error)) goto out; if (!ostree_sysroot_load (sysroot, cancellable, error)) diff --git a/src/ostree/ot-admin-builtin-init-fs.c b/src/ostree/ot-admin-builtin-init-fs.c index 9fe46f4c..c6e76bec 100644 --- a/src/ostree/ot-admin-builtin-init-fs.c +++ b/src/ostree/ot-admin-builtin-init-fs.c @@ -48,7 +48,9 @@ ot_admin_builtin_init_fs (int argc, char **argv, GCancellable *cancellable, GErr context = g_option_context_new ("PATH - Initialize a root filesystem"); - if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error)) + if (!ostree_admin_option_context_parse (context, options, &argc, &argv, + OSTREE_ADMIN_BUILTIN_FLAG_NONE, + &sysroot, cancellable, error)) goto out; if (argc < 2) diff --git a/src/ostree/ot-admin-builtin-instutil.c b/src/ostree/ot-admin-builtin-instutil.c index ba4d9b42..2d404872 100644 --- a/src/ostree/ot-admin-builtin-instutil.c +++ b/src/ostree/ot-admin-builtin-instutil.c @@ -116,7 +116,9 @@ ot_admin_builtin_instutil (int argc, char **argv, GCancellable *cancellable, GEr context = ostree_admin_instutil_option_context_new_with_commands (); /* This will not return for some options (e.g. --version). */ - if (ostree_admin_option_context_parse (context, NULL, &argc, &argv, NULL, cancellable, error)) + if (ostree_admin_option_context_parse (context, NULL, &argc, &argv, + OSTREE_ADMIN_BUILTIN_FLAG_NONE, + NULL, cancellable, error)) { if (subcommand_name == NULL) { diff --git a/src/ostree/ot-admin-builtin-os-init.c b/src/ostree/ot-admin-builtin-os-init.c index 38a4de10..2927fe78 100644 --- a/src/ostree/ot-admin-builtin-os-init.c +++ b/src/ostree/ot-admin-builtin-os-init.c @@ -46,7 +46,9 @@ ot_admin_builtin_os_init (int argc, char **argv, GCancellable *cancellable, GErr context = g_option_context_new ("OSNAME - Initialize empty state for given operating system"); - if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error)) + if (!ostree_admin_option_context_parse (context, options, &argc, &argv, + OSTREE_ADMIN_BUILTIN_FLAG_NONE, + &sysroot, cancellable, error)) goto out; if (!ostree_sysroot_ensure_initialized (sysroot, cancellable, error)) diff --git a/src/ostree/ot-admin-builtin-set-origin.c b/src/ostree/ot-admin-builtin-set-origin.c index 3beed86a..21d8ac9c 100644 --- a/src/ostree/ot-admin-builtin-set-origin.c +++ b/src/ostree/ot-admin-builtin-set-origin.c @@ -55,7 +55,9 @@ ot_admin_builtin_set_origin (int argc, char **argv, GCancellable *cancellable, G context = g_option_context_new ("REMOTENAME URL [BRANCH]"); - if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error)) + if (!ostree_admin_option_context_parse (context, options, &argc, &argv, + OSTREE_ADMIN_BUILTIN_FLAG_NONE, + &sysroot, cancellable, error)) goto out; if (argc < 3) diff --git a/src/ostree/ot-admin-builtin-status.c b/src/ostree/ot-admin-builtin-status.c index 382c5e61..d0b1aed4 100644 --- a/src/ostree/ot-admin-builtin-status.c +++ b/src/ostree/ot-admin-builtin-status.c @@ -62,7 +62,9 @@ ot_admin_builtin_status (int argc, char **argv, GCancellable *cancellable, GErro context = g_option_context_new ("List deployments"); - if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error)) + if (!ostree_admin_option_context_parse (context, options, &argc, &argv, + OSTREE_ADMIN_BUILTIN_FLAG_NONE, + &sysroot, cancellable, error)) goto out; if (!ostree_sysroot_load (sysroot, cancellable, error)) diff --git a/src/ostree/ot-admin-builtin-switch.c b/src/ostree/ot-admin-builtin-switch.c index ff9d6e9d..7cfaebf9 100644 --- a/src/ostree/ot-admin-builtin-switch.c +++ b/src/ostree/ot-admin-builtin-switch.c @@ -68,7 +68,9 @@ ot_admin_builtin_switch (int argc, char **argv, GCancellable *cancellable, GErro context = g_option_context_new ("REF - Construct new tree from current origin and deploy it, if it changed"); - if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error)) + if (!ostree_admin_option_context_parse (context, options, &argc, &argv, + OSTREE_ADMIN_BUILTIN_FLAG_NONE, + &sysroot, cancellable, error)) goto out; if (argc < 2) diff --git a/src/ostree/ot-admin-builtin-undeploy.c b/src/ostree/ot-admin-builtin-undeploy.c index 9196e5bf..be864b13 100644 --- a/src/ostree/ot-admin-builtin-undeploy.c +++ b/src/ostree/ot-admin-builtin-undeploy.c @@ -46,7 +46,9 @@ ot_admin_builtin_undeploy (int argc, char **argv, GCancellable *cancellable, GEr context = g_option_context_new ("INDEX - Delete deployment INDEX"); - if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error)) + if (!ostree_admin_option_context_parse (context, options, &argc, &argv, + OSTREE_ADMIN_BUILTIN_FLAG_NONE, + &sysroot, cancellable, error)) goto out; if (argc < 2) diff --git a/src/ostree/ot-admin-builtin-upgrade.c b/src/ostree/ot-admin-builtin-upgrade.c index 5ccd0b34..a1e4aa34 100644 --- a/src/ostree/ot-admin-builtin-upgrade.c +++ b/src/ostree/ot-admin-builtin-upgrade.c @@ -67,7 +67,9 @@ ot_admin_builtin_upgrade (int argc, char **argv, GCancellable *cancellable, GErr context = g_option_context_new ("Construct new tree from current origin and deploy it, if it changed"); - if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error)) + if (!ostree_admin_option_context_parse (context, options, &argc, &argv, + OSTREE_ADMIN_BUILTIN_FLAG_NONE, + &sysroot, cancellable, error)) goto out; if (!ostree_sysroot_load (sysroot, cancellable, error)) diff --git a/src/ostree/ot-admin-instutil-builtin-grub2-generate.c b/src/ostree/ot-admin-instutil-builtin-grub2-generate.c index 617b1608..3af1f34e 100644 --- a/src/ostree/ot-admin-instutil-builtin-grub2-generate.c +++ b/src/ostree/ot-admin-instutil-builtin-grub2-generate.c @@ -47,7 +47,9 @@ ot_admin_instutil_builtin_grub2_generate (int argc, char **argv, GCancellable *c context = g_option_context_new ("[BOOTVERSION] - generate GRUB2 configuration from given BLS entries"); - if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error)) + if (!ostree_admin_option_context_parse (context, options, &argc, &argv, + OSTREE_ADMIN_BUILTIN_FLAG_NONE, + &sysroot, cancellable, error)) goto out; if (argc >= 2) diff --git a/src/ostree/ot-admin-instutil-builtin-selinux-ensure-labeled.c b/src/ostree/ot-admin-instutil-builtin-selinux-ensure-labeled.c index 7e9ca060..130cf3bc 100644 --- a/src/ostree/ot-admin-instutil-builtin-selinux-ensure-labeled.c +++ b/src/ostree/ot-admin-instutil-builtin-selinux-ensure-labeled.c @@ -194,7 +194,9 @@ ot_admin_instutil_builtin_selinux_ensure_labeled (int argc, char **argv, GCancel context = g_option_context_new ("[SUBPATH PREFIX] - relabel all or part of a deployment"); - if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error)) + if (!ostree_admin_option_context_parse (context, options, &argc, &argv, + OSTREE_ADMIN_BUILTIN_FLAG_NONE, + &sysroot, cancellable, error)) goto out; if (!ostree_sysroot_load (sysroot, cancellable, error)) diff --git a/src/ostree/ot-admin-instutil-builtin-set-kargs.c b/src/ostree/ot-admin-instutil-builtin-set-kargs.c index cef52428..9bbad88b 100644 --- a/src/ostree/ot-admin-instutil-builtin-set-kargs.c +++ b/src/ostree/ot-admin-instutil-builtin-set-kargs.c @@ -56,7 +56,9 @@ ot_admin_instutil_builtin_set_kargs (int argc, char **argv, GCancellable *cancel context = g_option_context_new ("ARGS - set new kernel command line arguments"); - if (!ostree_admin_option_context_parse (context, options, &argc, &argv, &sysroot, cancellable, error)) + if (!ostree_admin_option_context_parse (context, options, &argc, &argv, + OSTREE_ADMIN_BUILTIN_FLAG_NONE, + &sysroot, cancellable, error)) goto out; if (!ostree_sysroot_load (sysroot, cancellable, error)) diff --git a/src/ostree/ot-builtin-admin.c b/src/ostree/ot-builtin-admin.c index b194143c..6cc63846 100644 --- a/src/ostree/ot-builtin-admin.c +++ b/src/ostree/ot-builtin-admin.c @@ -130,7 +130,9 @@ ostree_builtin_admin (int argc, char **argv, GCancellable *cancellable, GError * context = ostree_admin_option_context_new_with_commands (); /* This will not return for some options (e.g. --version). */ - if (ostree_admin_option_context_parse (context, NULL, &argc, &argv, NULL, cancellable, error)) + if (ostree_admin_option_context_parse (context, NULL, &argc, &argv, + OSTREE_ADMIN_BUILTIN_FLAG_NONE, + NULL, cancellable, error)) { if (subcommand_name == NULL) { diff --git a/src/ostree/ot-main.c b/src/ostree/ot-main.c index 94d29ca6..b1ad20e0 100644 --- a/src/ostree/ot-main.c +++ b/src/ostree/ot-main.c @@ -308,6 +308,7 @@ ostree_admin_option_context_parse (GOptionContext *context, const GOptionEntry *main_entries, int *argc, char ***argv, + OstreeAdminBuiltinFlags flags, OstreeSysroot **out_sysroot, GCancellable *cancellable, GError **error) diff --git a/src/ostree/ot-main.h b/src/ostree/ot-main.h index 659727f3..b1c58a04 100644 --- a/src/ostree/ot-main.h +++ b/src/ostree/ot-main.h @@ -30,6 +30,10 @@ typedef enum { OSTREE_BUILTIN_FLAG_NO_CHECK = 1 << 1 } OstreeBuiltinFlags; +typedef enum { + OSTREE_ADMIN_BUILTIN_FLAG_NONE = 0, +} OstreeAdminBuiltinFlags; + typedef struct { const char *name; gboolean (*fn) (int argc, char **argv, GCancellable *cancellable, GError **error); @@ -49,6 +53,7 @@ gboolean ostree_option_context_parse (GOptionContext *context, gboolean ostree_admin_option_context_parse (GOptionContext *context, const GOptionEntry *main_entries, int *argc, char ***argv, + OstreeAdminBuiltinFlags flags, OstreeSysroot **out_sysroot, GCancellable *cancellable, GError **error);