2020-01-28 22:41:27 +00:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2020-01-31 23:58:10 +00:00
|
|
|
"log"
|
2020-01-28 22:41:27 +00:00
|
|
|
"os"
|
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
// rootCmd represents the base command when called without any subcommands.
|
|
|
|
var rootCmd = &cobra.Command{
|
|
|
|
Use: "testtool",
|
|
|
|
Short: "test submissions",
|
|
|
|
TraverseChildren: true,
|
|
|
|
}
|
|
|
|
|
2020-01-31 23:58:10 +00:00
|
|
|
func init() {
|
|
|
|
log.SetPrefix("testtool: ")
|
|
|
|
log.SetFlags(0)
|
|
|
|
}
|
|
|
|
|
2020-01-28 22:41:27 +00:00
|
|
|
// Execute adds all child commands to the root command and sets flags appropriately.
|
|
|
|
// This is called by main.main(). It only needs to happen once to the rootCmd.
|
|
|
|
func Execute() {
|
|
|
|
if err := rootCmd.Execute(); err != nil {
|
2020-01-31 23:58:10 +00:00
|
|
|
fmt.Fprintln(os.Stderr, err)
|
2020-01-28 22:41:27 +00:00
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
}
|