Merge pull request #1 from Marcusk19/add_init

add init command
pull/4/head
Marcus Kok 2 years ago committed by GitHub
commit 5a6412584d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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…
Cancel
Save