Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
lima-vm
GitHub Repository: lima-vm/lima
Path: blob/master/cmd/limactl/start-at-login.go
2632 views
1
// SPDX-FileCopyrightText: Copyright The Lima Authors
2
// SPDX-License-Identifier: Apache-2.0
3
4
package main
5
6
import (
7
"github.com/spf13/cobra"
8
)
9
10
func newStartAtLoginCommand() *cobra.Command {
11
startAtLoginCommand := &cobra.Command{
12
Use: "start-at-login INSTANCE",
13
Short: "Register/Unregister an autostart file for the instance",
14
Args: WrapArgsError(cobra.MaximumNArgs(1)),
15
RunE: startAtLoginAction,
16
ValidArgsFunction: startAtLoginComplete,
17
GroupID: advancedCommand,
18
}
19
20
startAtLoginCommand.Flags().Bool(
21
"enabled", true,
22
"Automatically start the instance when the user logs in",
23
)
24
25
return startAtLoginCommand
26
}
27
28
func startAtLoginComplete(cmd *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) {
29
return bashCompleteInstanceNames(cmd)
30
}
31
32