Get bool set flags ported

This commit is contained in:
Kovid Goyal
2022-08-17 09:34:03 +05:30
parent 15ffd8e6d8
commit 3a87cfce3e
3 changed files with 50 additions and 11 deletions

View File

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