mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-28 03:53:33 +00:00
init machined cli
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
"uncloud/cmd/machined/install"
|
||||
"uncloud/internal/machine/daemon"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var dataDir string
|
||||
cmd := &cobra.Command{
|
||||
Use: "machined",
|
||||
Short: "Uncloud machine daemon.",
|
||||
SilenceUsage: true,
|
||||
SilenceErrors: true,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return daemon.Run(dataDir)
|
||||
},
|
||||
}
|
||||
cmd.PersistentFlags().StringVarP(&dataDir, "data-dir", "d", daemon.DefaultDataDir, "Directory to store machine state")
|
||||
_ = cmd.MarkFlagDirname("data-dir")
|
||||
cmd.AddCommand(
|
||||
install.NewCommand(&dataDir),
|
||||
)
|
||||
cobra.CheckErr(cmd.Execute())
|
||||
}
|
||||
Reference in New Issue
Block a user