mirror of
https://github.com/anchore/syft
synced 2024-11-10 06:14:16 +00:00
41 lines
620 B
Go
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) {
|
|
|
|
}
|