diff --git a/tools/cli/command.go b/tools/cli/command.go index 13f774a1b..ec213746f 100644 --- a/tools/cli/command.go +++ b/tools/cli/command.go @@ -35,6 +35,8 @@ type Command struct { StopCompletingAtArg int // Consider all args as non-options args OnlyArgsAllowed bool + // Pass through all args, useful for wrapper commands + IgnoreAllArgs bool // Specialised arg aprsing ParseArgsForCompletion func(cmd *Command, args []string, completions *Completions) diff --git a/tools/cli/parse-args.go b/tools/cli/parse-args.go index cddb3946a..fc34f10eb 100644 --- a/tools/cli/parse-args.go +++ b/tools/cli/parse-args.go @@ -13,6 +13,10 @@ func (self *Command) parse_args(ctx *Context, args []string) error { args_to_parse := make([]string, len(args)) copy(args_to_parse, args) ctx.SeenCommands = append(ctx.SeenCommands, self) + if self.IgnoreAllArgs { + self.Args = args + return nil + } var expecting_arg_for *Option options_allowed := true diff --git a/tools/cmd/ssh/main.go b/tools/cmd/ssh/main.go index 3aea013c6..b23908571 100644 --- a/tools/cmd/ssh/main.go +++ b/tools/cmd/ssh/main.go @@ -22,4 +22,5 @@ func specialize_command(ssh *cli.Command) { ssh.Usage = "arguments for the ssh command" ssh.ShortDescription = "Truly convenient SSH" ssh.HelpText = "The ssh kitten is a thin wrapper around the ssh command. It automatically enables shell integration on the remote host, re-uses existing connections to reduce latency, makes the kitty terminfo database available, etc. It's invocation is identical to the ssh command. For details on its usage, see :doc:`/kittens/ssh`." + ssh.IgnoreAllArgs = true }