wip: initial work

This commit is contained in:
2023-08-28 18:12:31 +10:00
parent ec3b108111
commit 9cbdbebee5
7 changed files with 71 additions and 0 deletions

35
cmd/cmd.go Normal file
View File

@@ -0,0 +1,35 @@
package cmd
import (
"gitea.suyono.dev/suyono/wingmate/cmd/init"
"github.com/spf13/cobra"
"os"
)
var (
rootCmd = &cobra.Command{
Use: "wingmate",
Short: "your service companion",
}
initCmd = &cobra.Command{
Use: "init",
Short: "dummy init",
Args: cobra.NoArgs,
RunE: init.Command,
}
)
func init() {
rootCmd.AddCommand(initCmd)
}
func Execute() error {
if os.Args[0] != rootCmd.Use {
rootCmd.SetArgs(os.Args)
} else {
rootCmd.SetArgs(os.Args[1:])
}
return rootCmd.Execute()
}

7
cmd/init/init.go Normal file
View File

@@ -0,0 +1,7 @@
package init
import "github.com/spf13/cobra"
func Command(cmd *cobra.Command, args []string) error {
return nil
}