mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-11-18 22:22:22 +00:00
51 lines
1.5 KiB
Go
Generated
51 lines
1.5 KiB
Go
Generated
// Code generated by go_code.py; DO NOT EDIT.
|
|
|
|
package resize_window
|
|
import "fmt"
|
|
import "github.com/kovidgoyal/kitty/tools/cli"
|
|
var _ = fmt.Sprintf
|
|
func create_cmd(root *cli.Command, run_func func(*cli.Command, *Options, []string)(int, error)) {
|
|
ans := root.AddSubCommand(&cli.Command{
|
|
Name: "resize_window",
|
|
ShortDescription: "Resize the current window interactively",
|
|
HelpText: "Resize the current window",
|
|
Run: func(cmd *cli.Command, args []string) (int, error) {
|
|
opts := Options{}
|
|
err := cmd.GetOptionValues(&opts)
|
|
if err != nil { return 1, err }
|
|
return run_func(cmd, &opts, args)},
|
|
Hidden: true,
|
|
})
|
|
ans.Add(cli.OptionSpec{
|
|
Name: "--horizontal-increment",
|
|
Type: "int",
|
|
Dest: "HorizontalIncrement",
|
|
Help: "The base horizontal increment.",
|
|
|
|
Default: "2",
|
|
})
|
|
ans.Add(cli.OptionSpec{
|
|
Name: "--vertical-increment",
|
|
Type: "int",
|
|
Dest: "VerticalIncrement",
|
|
Help: "The base vertical increment.",
|
|
|
|
Default: "2",
|
|
})
|
|
clone := root.AddClone(ans.Group, ans)
|
|
clone.Hidden = false
|
|
clone.Name = "resize-window"
|
|
}
|
|
type Options struct {
|
|
HorizontalIncrement int
|
|
VerticalIncrement int
|
|
}
|
|
func (opts Options) AsCommandLine() (ans []string) {
|
|
sval := ""
|
|
_ = sval
|
|
sval = fmt.Sprintf(`%d`, opts.HorizontalIncrement)
|
|
if (sval != `2`) { ans = append(ans, `--horizontal-increment=` + sval)}
|
|
sval = fmt.Sprintf(`%d`, opts.VerticalIncrement)
|
|
if (sval != `2`) { ans = append(ans, `--vertical-increment=` + sval)}
|
|
return
|
|
}
|