dont parse args for the ssh kitten as it will do so itself

This commit is contained in:
Kovid Goyal 2023-02-19 20:37:17 +05:30
parent 46367bceed
commit 590c1bd7ad
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 7 additions and 0 deletions

View File

@ -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)

View File

@ -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

View File

@ -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
}