cli

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PROTOBOM_LONG_DESCRIPTION  = "Translate SBOM formats such as CycloneDX and SPDX"
	PROTOBOM_SHORT_DESCRIPTION = "Translate SBOM formats"
	ProtobomUserExample        = `` /* 375-byte string literal not displayed */

)

Variables

View Source
var (
	ApplicationName = "protobom"
	Cfg             internal.Application
)
View Source
var RootCmd = &cobra.Command{
	Long:  PROTOBOM_LONG_DESCRIPTION,
	Use:   fmt.Sprintf("%s [sbom]", ApplicationName),
	Short: PROTOBOM_SHORT_DESCRIPTION,
	Example: Tprintf(ProtobomUserExample, map[string]interface{}{
		"appName": ApplicationName,
	}),
	DisableAutoGenTag: true,
	CompletionOptions: cobra.CompletionOptions{DisableDefaultCmd: true},
	Args:              cobra.MinimumNArgs(1),
	Hidden:            false,
	SilenceUsage:      true,
	SilenceErrors:     false,
	PreRunE: func(cmd *cobra.Command, args []string) error {
		return nil
	},
	RunE: func(cmd *cobra.Command, args []string) error {
		path := args[0]
		logrus.Infof("Running %s on %s", ApplicationName, path)

		v, err := json.MarshalIndent(Cfg, "", " ")
		if err != nil {
			return err
		}
		logrus.WithField("config", string(v)).Debugf("Protobom config")

		err = internal.Translate(path, &Cfg)
		return err
	},
}

Functions

func Execute

func Execute()

func Tprintf

func Tprintf(tmpl string, data map[string]interface{}) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL