Skip to content

Commit

Permalink
Default to current connection for wsh conn reinstall (#1782)
Browse files Browse the repository at this point in the history
  • Loading branch information
esimkowitz authored Jan 21, 2025
1 parent 5f65d85 commit 4fba9e6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/wsh/cmd/wshcmd-conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4fba9e6

Please sign in to comment.