mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-12-24 20:35:03 -07:00
feat(golang-rewrite): add boilerplate for cobra CLI commands
This commit is contained in:
parent
a08b71219d
commit
229ca564f7
37
commands/commands.go
Normal file
37
commands/commands.go
Normal file
@ -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)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user