diff --git a/commands/commands.go b/commands/commands.go new file mode 100644 index 00000000..7b8c9b35 --- /dev/null +++ b/commands/commands.go @@ -0,0 +1,37 @@ +package commands + +import ( + "fmt" + "os" + + "github.com/spf13/cobra" +) + +var rootCmd = &cobra.Command{ + Use: "asdf", + Short: "The multiple runtime version manager", + Long: `The Multiple Runtime Version Manager. + +Manage all your runtime versions with one tool! + +Complete documentation is available at https://asdf-vm.com/`, + Run: func(cmd *cobra.Command, args []string) { + // TODO: Flesh this out + fmt.Println("Late but latest -- Rajinikanth") + }, +} + +func init() { + // TODO: Add flags relevant to all commands + //rootCmd.PersistentFlags().BoolVarP(&Verbose, "verbose", "v", false, "verbose output") + + // TODO: Add sub commands + //rootCmd.AddCommand(pluginCmd) +} + +func Execute() { + if err := rootCmd.Execute(); err != nil { + fmt.Println(err) + os.Exit(1) + } +} diff --git a/main.go b/main.go index db9d76ca..e23893f4 100644 --- a/main.go +++ b/main.go @@ -1,8 +1,10 @@ package main -import "fmt" +import ( + "asdf/commands" +) // Placeholder for the real code func main() { - fmt.Println("Late but latest -- Rajinikanth") + commands.Execute() }