-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
main: add support for CLI extensions via external binaries #2500
Conversation
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`.
faa84f0
to
513b3c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, this is nice and straightforward.
${CMD_PREFIX} ostree env --help >out.txt | ||
assert_file_has_content out.txt "with an empty environment" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about e.g.:
${CMD_PREFIX} ostree env --help >out.txt | |
assert_file_has_content out.txt "with an empty environment" | |
${CMD_PREFIX} env sometestenv=foo ostree env >out.txt | |
assert_file_has_content out.txt '^sometestenv=foo` |
or so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also realized there were some leftovers in the environment. #2501 takes care of all that.
Eh rather than re-roll CI for a nit, just going to merge; we can do the above as a followup. |
We can do this now that ostree 2022.1 is out with ostreedev/ostree#2500 There are two notable aspects to this: - Previously the code here was a mix of `ostree` and `rpm-ostree`; but it's all "pure ostree stuff", and now it is all much more consistent. This also helps us eventually put more functionality in `ostree` that was formerly in `rpm-ostree`. - We're kind of implicitly saying the container bits aren't experimental anymore, which...they probably shouldn't be in rpm-ostree side either.
We can do this now that ostree 2022.1 is out with ostreedev/ostree#2500 There are two notable aspects to this: - Previously the code here was a mix of `ostree` and `rpm-ostree`; but it's all "pure ostree stuff", and now it is all much more consistent. This also helps us eventually put more functionality in `ostree` that was formerly in `rpm-ostree`. - We're kind of implicitly saying the container bits aren't experimental anymore, which...they probably shouldn't be in rpm-ostree side either.
We can do this now that ostree 2022.1 is out with ostreedev/ostree#2500 There are two notable aspects to this: - Previously the code here was a mix of `ostree` and `rpm-ostree`; but it's all "pure ostree stuff", and now it is all much more consistent. This also helps us eventually put more functionality in `ostree` that was formerly in `rpm-ostree`. - We're kind of implicitly saying the container bits aren't experimental anymore, which...they probably shouldn't be in rpm-ostree side either.
We can do this now that ostree 2022.1 is out with ostreedev/ostree#2500 There are two notable aspects to this: - Previously the code here was a mix of `ostree` and `rpm-ostree`; but it's all "pure ostree stuff", and now it is all much more consistent. This also helps us eventually put more functionality in `ostree` that was formerly in `rpm-ostree`. - We're kind of implicitly saying the container bits aren't experimental anymore, which...they probably shouldn't be in rpm-ostree side either.
We can do this now that ostree 2022.1 is out with ostreedev/ostree#2500 There are two notable aspects to this: - Previously the code here was a mix of `ostree` and `rpm-ostree`; but it's all "pure ostree stuff", and now it is all much more consistent. This also helps us eventually put more functionality in `ostree` that was formerly in `rpm-ostree`. - We're kind of implicitly saying the container bits aren't experimental anymore, which...they probably shouldn't be in rpm-ostree side either.
We can do this now that ostree 2022.1 is out with ostreedev/ostree#2500 There are two notable aspects to this: - Previously the code here was a mix of `ostree` and `rpm-ostree`; but it's all "pure ostree stuff", and now it is all much more consistent. This also helps us eventually put more functionality in `ostree` that was formerly in `rpm-ostree`. - We're kind of implicitly saying the container bits aren't experimental anymore, which...they probably shouldn't be in rpm-ostree side either.
This adds some logic to detect and dispatch unknown subcommands to
extensions available in
$PATH
. Additional commands can beimplemented 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 thatas
ostree-extcommand extcommand --help
.Closes: #2480