mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-03-01 03:51:59 +01:00
Default to current connection for wsh conn reinstall
(#1782)
This commit is contained in:
parent
5f65d85d00
commit
4fba9e6caa
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user