DRYer
This commit is contained in:
parent
b3be6792fd
commit
e127579ae6
@ -170,30 +170,31 @@ func EntryPoint(tool_root *cobra.Command) *cobra.Command {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
at_root_command.Annotations["options_title"] = "Global options"
|
at_root_command.Annotations["options_title"] = "Global options"
|
||||||
|
fs := at_root_command.PersistentFlags()
|
||||||
|
|
||||||
to = at_root_command.PersistentFlags().String("to", "",
|
to = fs.String("to", "",
|
||||||
"An address for the kitty instance to control. Corresponds to the address given"+
|
"An address for the kitty instance to control. Corresponds to the address given"+
|
||||||
" to the kitty instance via the :option:`kitty --listen-on` option or the :opt:`listen_on` setting in :file:`kitty.conf`. If not"+
|
" to the kitty instance via the :option:`kitty --listen-on` option or the :opt:`listen_on` setting in :file:`kitty.conf`. If not"+
|
||||||
" specified, the environment variable :envvar:`KITTY_LISTEN_ON` is checked. If that"+
|
" specified, the environment variable :envvar:`KITTY_LISTEN_ON` is checked. If that"+
|
||||||
" is also not found, messages are sent to the controlling terminal for this"+
|
" is also not found, messages are sent to the controlling terminal for this"+
|
||||||
" process, i.e. they will only work if this process is run within a kitty window.")
|
" process, i.e. they will only work if this process is run within a kitty window.")
|
||||||
|
|
||||||
password = at_root_command.PersistentFlags().String("password", "",
|
password = fs.String("password", "",
|
||||||
"A password to use when contacting kitty. This will cause kitty to ask the user"+
|
"A password to use when contacting kitty. This will cause kitty to ask the user"+
|
||||||
" for permission to perform the specified action, unless the password has been"+
|
" for permission to perform the specified action, unless the password has been"+
|
||||||
" accepted before or is pre-configured in :file:`kitty.conf`.")
|
" accepted before or is pre-configured in :file:`kitty.conf`.")
|
||||||
|
|
||||||
password_file = at_root_command.PersistentFlags().String("password-file", "rc-pass",
|
password_file = fs.String("password-file", "rc-pass",
|
||||||
"A file from which to read the password. Trailing whitespace is ignored. Relative"+
|
"A file from which to read the password. Trailing whitespace is ignored. Relative"+
|
||||||
" paths are resolved from the kitty configuration directory. Use - to read from STDIN."+
|
" paths are resolved from the kitty configuration directory. Use - to read from STDIN."+
|
||||||
" Used if no :option:`--password` is supplied. Defaults to checking for the"+
|
" Used if no :option:`--password` is supplied. Defaults to checking for the"+
|
||||||
" :file:`rc-pass` file in the kitty configuration directory.")
|
" :file:`rc-pass` file in the kitty configuration directory.")
|
||||||
|
|
||||||
password_env = at_root_command.PersistentFlags().String("password-env", "KITTY_RC_PASSWORD",
|
password_env = fs.String("password-env", "KITTY_RC_PASSWORD",
|
||||||
"The name of an environment variable to read the password from."+
|
"The name of an environment variable to read the password from."+
|
||||||
" Used if no :option:`--password-file` or :option:`--password` is supplied.")
|
" Used if no :option:`--password-file` or :option:`--password` is supplied.")
|
||||||
|
|
||||||
use_password = cli.Choices(at_root_command.PersistentFlags(), "use-password", "If no password is available, kitty will usually just send the remote control command without a password. This option can be used to force it to always or never use the supplied password.", "if-available", "always", "never")
|
use_password = cli.Choices(fs, "use-password", "If no password is available, kitty will usually just send the remote control command without a password. This option can be used to force it to always or never use the supplied password.", "if-available", "always", "never")
|
||||||
|
|
||||||
for cmd_name, reg_func := range all_commands {
|
for cmd_name, reg_func := range all_commands {
|
||||||
c := reg_func(at_root_command)
|
c := reg_func(at_root_command)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user