wip: initial work
This commit is contained in:
35
cmd/cmd.go
Normal file
35
cmd/cmd.go
Normal 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
7
cmd/init/init.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package init
|
||||
|
||||
import "github.com/spf13/cobra"
|
||||
|
||||
func Command(cmd *cobra.Command, args []string) error {
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user