mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-12 03:29:10 +02:00
Get bool set flags ported
This commit is contained in:
@@ -19,6 +19,13 @@ import (
|
||||
"kitty/tools/utils"
|
||||
)
|
||||
|
||||
func add_bool_set(cmd *cobra.Command, name string, short string, usage string) *bool {
|
||||
if short == "" {
|
||||
return cmd.Flags().Bool(name, false, usage)
|
||||
}
|
||||
return cmd.Flags().BoolP(name, short, false, usage)
|
||||
}
|
||||
|
||||
type GlobalOptions struct {
|
||||
to_address, password string
|
||||
to_address_is_from_env_var bool
|
||||
|
||||
@@ -13,8 +13,13 @@ import (
|
||||
|
||||
func run_CMD_NAME(cmd *cobra.Command, args []string) (err error) {
|
||||
rc := utils.RemoteControlCmd{
|
||||
Cmd: "CLI_NAME",
|
||||
Version: [3]int{0, 20, 0},
|
||||
Cmd: "CLI_NAME",
|
||||
Version: [3]int{0, 20, 0},
|
||||
NoResponse: NO_RESPONSE_BASE,
|
||||
}
|
||||
nrv, err := cmd.Flags().GetBool("no-response")
|
||||
if err == nil {
|
||||
rc.NoResponse = nrv
|
||||
}
|
||||
err = send_rc_command(&rc)
|
||||
return
|
||||
@@ -27,6 +32,7 @@ func setup_CMD_NAME(root *cobra.Command) *cobra.Command {
|
||||
Long: "LONG_DESC",
|
||||
RunE: run_CMD_NAME,
|
||||
})
|
||||
ADD_FLAGS_CODE
|
||||
|
||||
return ans
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user