Default to current connection for wsh conn reinstall (#1782)

This commit is contained in:
Evan Simkowitz 2025-01-20 19:49:43 -08:00 committed by GitHub
parent 5f65d85d00
commit 4fba9e6caa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,7 +30,6 @@ var connStatusCmd = &cobra.Command{
var connReinstallCmd = &cobra.Command{
Use: "reinstall CONNECTION",
Short: "reinstall wsh on a connection",
Args: cobra.ExactArgs(1),
RunE: connReinstallRun,
PreRunE: preRunSetupRpcClient,
}
@ -124,6 +123,12 @@ func connStatusRun(cmd *cobra.Command, args []string) error {
}
func connReinstallRun(cmd *cobra.Command, args []string) error {
if len(args) != 1 {
if RpcContext.Conn == "" {
return fmt.Errorf("no connection specified")
}
args = []string{RpcContext.Conn}
}
connName := args[0]
if err := validateConnectionName(connName); err != nil {
return err