@@ -34,6 +34,7 @@ Not to be confused with 'limactl copy' ('limactl cp').
3434 ValidArgsFunction : cloneBashComplete ,
3535 GroupID : advancedCommand ,
3636 }
37+ cloneCommand .Flags ().Bool ("start" , false , "Start the instance after cloning" )
3738 editflags .RegisterEdit (cloneCommand , "[limactl edit] " )
3839 return cloneCommand
3940}
@@ -48,6 +49,7 @@ func newRenameCommand() *cobra.Command {
4849 ValidArgsFunction : cloneBashComplete ,
4950 GroupID : advancedCommand ,
5051 }
52+ renameCommand .Flags ().Bool ("start" , false , "Start the instance after renaming" )
5153 editflags .RegisterEdit (renameCommand , "[limactl edit] " )
5254 return renameCommand
5355}
@@ -113,15 +115,18 @@ func cloneOrRenameAction(cmd *cobra.Command, args []string) error {
113115 }
114116 }
115117
116- if ! tty {
117- // use "start" to start it
118- return nil
119- }
120- startNow , err := askWhetherToStart ()
118+ start , err := flags .GetBool ("start" )
121119 if err != nil {
122120 return err
123121 }
124- if ! startNow {
122+
123+ if tty && ! flags .Changed ("start" ) {
124+ start , err = askWhetherToStart ()
125+ if err != nil {
126+ return err
127+ }
128+ }
129+ if ! start {
125130 return nil
126131 }
127132 err = reconcile .Reconcile (ctx , newInst .Name )
0 commit comments