Get completion working for kitten ssh

This commit is contained in:
Kovid Goyal 2023-02-19 20:50:58 +05:30
parent 590c1bd7ad
commit 407555c6c8
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 2 deletions

View File

@ -33,11 +33,11 @@ type Command struct {
ArgCompleter CompletionFunc ArgCompleter CompletionFunc
// Stop completion processing at this arg num // Stop completion processing at this arg num
StopCompletingAtArg int StopCompletingAtArg int
// Consider all args as non-options args // Consider all args as non-options args when parsing for completion
OnlyArgsAllowed bool OnlyArgsAllowed bool
// Pass through all args, useful for wrapper commands // Pass through all args, useful for wrapper commands
IgnoreAllArgs bool IgnoreAllArgs bool
// Specialised arg aprsing // Specialised arg parsing
ParseArgsForCompletion func(cmd *Command, args []string, completions *Completions) ParseArgsForCompletion func(cmd *Command, args []string, completions *Completions)
SubCommandGroups []*CommandGroup SubCommandGroups []*CommandGroup

View File

@ -23,4 +23,6 @@ func specialize_command(ssh *cli.Command) {
ssh.ShortDescription = "Truly convenient SSH" 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.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 ssh.IgnoreAllArgs = true
ssh.OnlyArgsAllowed = true
ssh.ArgCompleter = cli.CompletionForWrapper("ssh")
} }