diff options
author | Luca BRUNO <luca.bruno@coreos.com> | 2021-12-20 10:00:02 +0000 |
---|---|---|
committer | Luca BRUNO <luca.bruno@coreos.com> | 2021-12-20 10:00:02 +0000 |
commit | 513b3c09a54af31ffd1b0eb9b3c47849816483be (patch) | |
tree | d8fc230e2dd16fb0e88f0d4789f951a74a9cd234 /src/ostree/ot-main.h | |
parent | 365559eaa8126d60366b3f69585268dd89ce3a3a (diff) | |
download | ostree-513b3c09a54af31ffd1b0eb9b3c47849816483be.tar.gz |
main: add support for CLI extensions via external binaries
This adds some logic to detect and dispatch unknown subcommands to
extensions available in `$PATH`. Additional commands can be
implemented by adding relevant `ostree-$verb` binaries to the system.
As an example, if a `/usr/bin/ostree-extcommand` extension is provided,
the execution of `ostree extcommand --help` will be dispatched to that
as `ostree-extcommand extcommand --help`.
Diffstat (limited to 'src/ostree/ot-main.h')
-rw-r--r-- | src/ostree/ot-main.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ostree/ot-main.h b/src/ostree/ot-main.h index ed06e621..b369deb8 100644 --- a/src/ostree/ot-main.h +++ b/src/ostree/ot-main.h @@ -58,10 +58,16 @@ struct OstreeCommandInvocation { OstreeCommand *command; }; +int ostree_main (int argc, char **argv, OstreeCommand *commands); + int ostree_run (int argc, char **argv, OstreeCommand *commands, GError **error); int ostree_usage (OstreeCommand *commands, gboolean is_error); +char* ostree_command_lookup_external (int argc, char **argv, OstreeCommand *commands); + +int ostree_command_exec_external (char **argv); + gboolean ostree_parse_sysroot_or_repo_option (GOptionContext *context, const char *sysroot_path, const char *repo_path, |