コード例 #1
0
ファイル: cnt.go プロジェクト: vcaputo/cnt
func Execute() {
	log.Logger = logger.NewLogger()
	checkRktVersion()

	var rootCmd = &cobra.Command{Use: "cnt"}
	rootCmd.PersistentFlags().BoolVarP(&buildArgs.Clean, "clean", "c", false, "Clean before doing anything")
	rootCmd.PersistentFlags().StringVarP(&buildArgs.TargetPath, "target-path", "p", "", "Set target path")

	rootCmd.AddCommand(buildCmd, cleanCmd, pushCmd, installCmd, testCmd, versionCmd, initCmd, updateCmd, graphCmd)

	config.GetConfig().Load()
	rootCmd.Execute()

	log.Info("Victory !")
}
コード例 #2
0
ファイル: cnt.go プロジェクト: PrFalken/cnt
func Execute() {
	log.Set(logger.NewLogger())
	currentAbsDir, err := filepath.Abs("")
	if err != nil {
		log.Get().Panic("Cannot find current absolute directory")
	}
	var rootCmd = &cobra.Command{Use: "cnt"}
	buildCmd.Flags().BoolVarP(&buildArgs.Zip, "nozip", "z", false, "Zip final image or not")
	rootCmd.PersistentFlags().BoolVarP(&buildArgs.Clean, "clean", "c", false, "Clean before doing anything")
	rootCmd.PersistentFlags().StringVarP(&buildArgs.TargetPath, "target-path", "t", currentAbsDir, "Set target path")

	rootCmd.AddCommand(buildCmd, cleanCmd, pushCmd, installCmd, testCmd, versionCmd, initCmd, updateCmd)

	config.GetConfig().Load()
	rootCmd.Execute()

	log.Get().Info("Victory !")
}