Skip to content

Commit 08c5994

Browse files
committed
some tweaks
Signed-off-by: Ansuman Sahoo <[email protected]>
1 parent b16e5e7 commit 08c5994

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

cmd/limactl/shell.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func newShellCommand() *cobra.Command {
5050

5151
shellCmd.Flags().String("shell", "", "shell interpreter, e.g. /bin/bash")
5252
shellCmd.Flags().String("workdir", "", "working directory")
53-
shellCmd.Flags().BoolP("exit-session", "e", false, "exit a ssh session for the instance")
53+
shellCmd.Flags().Bool("restart-ssh", false, "restart the SSH connection")
5454
return shellCmd
5555
}
5656

@@ -83,11 +83,11 @@ func shellAction(cmd *cobra.Command, args []string) error {
8383
return fmt.Errorf("instance %q is stopped, run `limactl start %s` to start the instance", instName, instName)
8484
}
8585

86-
exit, err := cmd.Flags().GetBool("exit-session")
86+
restart, err := cmd.Flags().GetBool("restart-ssh")
8787
if err != nil {
8888
return err
8989
}
90-
if exit {
90+
if restart {
9191
logrus.Infof("Exiting ssh session for the instance %q", instName)
9292

9393
sshConfig := &ssh.SSHConfig{
@@ -99,8 +99,6 @@ func shellAction(cmd *cobra.Command, args []string) error {
9999
if err := ssh.ExitMaster(inst.Hostname, inst.SSHLocalPort, sshConfig); err != nil {
100100
return err
101101
}
102-
103-
return nil
104102
}
105103

106104
// When workDir is explicitly set, the shell MUST have workDir as the cwd, or exit with an error.

0 commit comments

Comments
 (0)