package cmd import ( "fmt" "os" "github.com/spf13/cobra" "github.com/spf13/viper" "git.metaunix.net/BitGoblin/adept/transcoder" ) // ./adept - this is the primary command and is how the service is intended to be launched var rootCmd = &cobra.Command{ Use: "adept", Short: "Adept is a video transcoder service", Long: `An automated video transcoder service that archives ingested footage. https://git.metaunix.net/BitGoblin/adept`, Run: func(cmd *cobra.Command, args []string) { // initialize the video repository r := transcoder.NewRepository(viper.GetString("transcoder.repository")) // create transcoder object and start the main loop t := transcoder.NewTranscoder(*r) t.Start() }, } // this is the main function to launch Cobra func Execute() { if err := rootCmd.Execute(); err != nil { fmt.Println(err) os.Exit(1) } }