Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrepareArgs ¶
PrepareArgs lets `enter` and `ephemeral` accept distrobox flags after the container name, like the bash distrobox-enter (which only starts the command at -e/--exec/--). urfave's StopOnNthArg can't express this: it stops at the first positional and can't tell the name from the command. So we find the command ourselves and splice a bare "--" in front of it, then let urfave parse the rest. It runs at the entrypoint because urfave has no pre-parse hook.
func ResolveArgs ¶
ResolveArgs supports v1-style subcommand invocation by basename. v1 shipped separate scripts (distrobox-create, distrobox-enter, …); v2 ships one binary with subcommands.
distrobox → no change distrobox-enter foo → distrobox enter foo distrobox-;s → distrobox ls
argv[0] is normalised to "distrobox" so help/usage output reads naturally regardless of which symlink was invoked.
Types ¶
type CommandComposer ¶
type CommandComposer[CFG any] struct { // contains filtered or unexported fields }
CommandComposer is a helper for building commands with options. It holds the config, so that options don't need to receive it as an argument.