mirror of https://github.com/Marcusk19/dotctl
add init command
parent
cc3e861065
commit
9643d3caa4
@ -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])
|
||||||
|
},
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue