From 9643d3caa4e89a1bd3e7ba080b38fd17e0e2709a Mon Sep 17 00:00:00 2001 From: Marcusk19 Date: Wed, 6 Mar 2024 18:37:06 -0500 Subject: [PATCH] add init command --- cmd/init.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 cmd/init.go diff --git a/cmd/init.go b/cmd/init.go new file mode 100644 index 0000000..25e65b2 --- /dev/null +++ b/cmd/init.go @@ -0,0 +1,23 @@ +package cmd + +import ( + "fmt" + "log" + + "github.com/spf13/cobra" +) + +func init() { + RootCmd.AddCommand(initCommand) +} + +var initCommand = &cobra.Command { + Use: "init", + Run: func(cmd *cobra.Command, args []string) { + if(len(args) <= 0) { + log.Fatal(cmd.OutOrStdout(), "no arguments provided to init") + } + // we will do something here, for now just print args[0] + fmt.Fprintf(cmd.OutOrStdout(), args[0]) + }, +}