#[non_exhaustive]pub enum Argv0Route {
Alias(Vec<String>),
Personality(Arc<dyn Fn() -> CliConfig + Send + Sync>),
}Expand description
How the engine behaves when invoked under a registered alternative argv[0]
name (busybox/git-style multi-call dispatch).
A route is selected when the binary’s argv[0] basename — or the name given
to the hidden argv0 command — matches a key registered via
CliConfig::with_argv0_alias or CliConfig::with_argv0_personality. An
argv[0] that matches no route falls through to the default CLI, so existing
applications that register no routes are unaffected.
Non-exhaustive: more route kinds may be added in future releases. Register
routes through the CliConfig builders rather than matching on variants.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Alias(Vec<String>)
Rewrite the invocation into these canonical subcommand tokens and run it through the normal command tree, with the real argument tail appended.
For example, an Alias(vec!["project".into(), "list".into()]) registered
under pl makes pl --team x behave exactly like project list --team x.
Personality(Arc<dyn Fn() -> CliConfig + Send + Sync>)
Run an entirely separate CLI application built from the returned
CliConfig (its own root name, commands, flags, and auth). The
configuration is built lazily, only when the route is actually dispatched,
so registering a personality costs nothing for invocations that never hit it.
Trait Implementations§
Source§impl Clone for Argv0Route
impl Clone for Argv0Route
Source§fn clone(&self) -> Argv0Route
fn clone(&self) -> Argv0Route
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more