github.com/twelho/conform@v0.0.0-20231016230407-c25e9238598a/cmd/conform/root.go (about)

     1  // This Source Code Form is subject to the terms of the Mozilla Public
     2  // License, v. 2.0. If a copy of the MPL was not distributed with this
     3  // file, You can obtain one at http://mozilla.org/MPL/2.0/.
     4  
     5  // Package main provides CLI commands.
     6  package main
     7  
     8  import (
     9  	"os"
    10  
    11  	"github.com/spf13/cobra"
    12  )
    13  
    14  // rootCmd represents the base command when called without any subcommands.
    15  var rootCmd = &cobra.Command{
    16  	Use:   "conform",
    17  	Short: "Policy enforcement for your pipelines.",
    18  	Long:  ``,
    19  }
    20  
    21  // Execute adds all child commands to the root command sets flags appropriately.
    22  // This is called by main.main(). It only needs to happen once to the rootCmd.
    23  func Execute() {
    24  	if err := rootCmd.Execute(); err != nil {
    25  		os.Exit(1)
    26  	}
    27  }