mirror of https://github.com/Marcusk19/dotctl
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
427 B
Go
24 lines
427 B
Go
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])
|
|
},
|
|
}
|