syft/cmd/root.go
2020-05-12 20:43:46 -04:00

41 lines
620 B
Go

package cmd
import (
"fmt"
"os"
"github.com/spf13/cobra"
)
const ApplicationName = "imgbom"
var rootOptions struct {
cfgFile string
}
var rootCmd = &cobra.Command{
Use: ApplicationName,
Short: "A container image BOM tool",
Long: `todo.`,
Run: doRunCmd,
}
func Execute() {
if err := rootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}
func init() {
cobra.OnInitialize(loadApplicationConfig)
rootCmd.PersistentFlags().StringVar(&rootOptions.cfgFile, "config", "", "config file")
}
func loadApplicationConfig() {
// TODO...
}
func doRunCmd(cmd *cobra.Command, args []string) {
}