Skip to content

Commit 2470386

Browse files
committed
limactl stop: stop "default" instance by default
Signed-off-by: Akihiro Suda <[email protected]>
1 parent b641d2d commit 2470386

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cmd/limactl/stop.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func newStopCommand() *cobra.Command {
2222
var stopCmd = &cobra.Command{
2323
Use: "stop INSTANCE",
2424
Short: "Stop an instance",
25-
Args: cobra.ExactArgs(1),
25+
Args: cobra.MaximumNArgs(1),
2626
RunE: stopAction,
2727
ValidArgsFunction: stopBashComplete,
2828
}
@@ -32,9 +32,9 @@ func newStopCommand() *cobra.Command {
3232
}
3333

3434
func stopAction(cmd *cobra.Command, args []string) error {
35-
instName := args[0]
36-
if instName == "" {
37-
instName = DefaultInstanceName
35+
instName := DefaultInstanceName
36+
if len(args) > 0 {
37+
instName = args[0]
3838
}
3939

4040
inst, err := store.Inspect(instName)

0 commit comments

Comments
 (0)