diff options
author | Ruixin Bao <peter.bao@mail.utoronto.ca> | 2017-10-17 17:25:04 +0000 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2017-10-20 12:59:33 +0000 |
commit | 298c151fd8f78e6c3f6f199cd32981ae3d311828 (patch) | |
tree | 596d088bc885b26d540d5bdb91ba89aa7b20c5b4 /src/ostree/ot-admin-builtin-cleanup.c | |
parent | 3c360a720ff1a8bf695365a79b3ac7975ffd25e8 (diff) | |
download | ostree-298c151fd8f78e6c3f6f199cd32981ae3d311828.tar.gz |
ostree: move flags into command struct, pass down through builtins
This is a similar approach as
https://github.com/projectatomic/rpm-ostree/commit/12c34bb2491a07079c911ef26401fee939e5573c.
One thing to note is when we parse the admin related functions,
we still keep the old admin related flags, and added a new parameter
to represent the command struct.
This allows us to identify the caller of the function, making it
easier for us to possibly deduplicate the subcommand handling in
the future. A similar approach is done in rpm-ostree:
https://github.com/projectatomic/rpm-ostree/commit/83aeb018c1012c7a43783c09b74ec71bc9c45826
This also makes it easier for us to change the prototype of the function.
If we want to add something new in the future, we won't need to touch every prototype.
Closes: #1267
Approved by: cgwalters
Diffstat (limited to 'src/ostree/ot-admin-builtin-cleanup.c')
-rw-r--r-- | src/ostree/ot-admin-builtin-cleanup.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ostree/ot-admin-builtin-cleanup.c b/src/ostree/ot-admin-builtin-cleanup.c index 954f8d8a..bc7a724b 100644 --- a/src/ostree/ot-admin-builtin-cleanup.c +++ b/src/ostree/ot-admin-builtin-cleanup.c @@ -38,7 +38,7 @@ static GOptionEntry options[] = { }; gboolean -ot_admin_builtin_cleanup (int argc, char **argv, GCancellable *cancellable, GError **error) +ot_admin_builtin_cleanup (int argc, char **argv, OstreeCommandInvocation *invocation, GCancellable *cancellable, GError **error) { g_autoptr(GOptionContext) context = NULL; g_autoptr(OstreeSysroot) sysroot = NULL; @@ -48,7 +48,7 @@ ot_admin_builtin_cleanup (int argc, char **argv, GCancellable *cancellable, GErr if (!ostree_admin_option_context_parse (context, options, &argc, &argv, OSTREE_ADMIN_BUILTIN_FLAG_SUPERUSER, - &sysroot, cancellable, error)) + invocation, &sysroot, cancellable, error)) goto out; if (!ostree_sysroot_cleanup (sysroot, cancellable, error)) |