Commit Graph

4 Commits

Author SHA1 Message Date
Jan Tojnar
1898019fac tests/test-cli-extensions: Fix with single-binary coreutils
On systems where `coreutils` are built with `--enable-single-binary=symlinks` like Nix,
`/usr/bin/env` is symlinked to `/usr/bin/coreutils` and uses `argv[0]` to determine which program to run.
Since the `test-cli-extensions.sh` created a new symlink named `ostree-env`,
coreutils would be confused about the utility to choose, so running it would fail:

	ostree-env: unknown program ‘ostree-env’
	Try 'ostree-env --help' for more information.

Fixes: https://github.com/ostreedev/ostree/issues/2553
2022-03-26 10:55:42 +01:00
Colin Walters
998154f8ff main: Also support CLI extensions in /usr/libexec/libostree/ext
In fixing https://github.com/coreos/rpm-ostree/pull/3323
I felt that it was a bit ugly we're installing `/usr/bin/ostree-container`.

It's kind of an implementation detail.  We want users to use
`ostree container`.

Let's support values outside of $PATH too.

For example, this also ensures that TAB completion for `ost` expands
to `ostree ` with a space.
2022-01-11 20:13:33 -05:00
Luca BRUNO
5dbe37ce78
tests/cli-extensions: tweak test logic
This updates the test logic for CLI extensions, actually checking
for functional output from the subcommand.
It also cleans up some environmental leftover.
2021-12-21 10:18:30 +00:00
Luca BRUNO
513b3c09a5
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`.
2021-12-20 10:00:02 +00:00