filegate/cmd/setup.go

34 lines
827 B
Go

package cmd
import (
"fmt"
"git.jmbit.de/filegate/filegate/db"
"github.com/spf13/cobra"
)
// setupCmd represents the setup command
var setupCmd = &cobra.Command{
Use: "setup",
Short: "Setup database",
Long: `Sets up the database with an admin user and group`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("setup called")
db.SetupDB()
},
}
func init() {
rootCmd.AddCommand(setupCmd)
// Here you will define your flags and configuration settings.
// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// setupCmd.PersistentFlags().String("foo", "", "A help for foo")
// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// setupCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}