command

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check() *cobra.Command

Check creates the check command

func Config added in v0.3.0

func Config() *cobra.Command

Config creates the config command

func HandleError added in v0.3.0

func HandleError(err error, quiet bool)

HandleError handles command errors consistently

func List

func List() *cobra.Command

List creates the list command

func LoadPolicyFromConfig added in v0.3.0

func LoadPolicyFromConfig(config *GlobalConfig) (*grant.Policy, error)

LoadPolicyFromConfig loads policy based on global config

func OutputResult added in v0.3.0

func OutputResult(result *grant.RunResponse, format string, outputFile string) error

OutputResult outputs the result in the specified format

func SetupLogging added in v0.3.1

func SetupLogging(verbose bool)

SetupLogging configures logging based on verbose flag

func Version added in v0.3.1

func Version() *cobra.Command

Version creates the version command

Types

type FullConfig added in v0.3.0

type FullConfig struct {
	// Global CLI options
	Config  string `yaml:"config,omitempty"`
	Format  string `yaml:"format"`
	Quiet   bool   `yaml:"quiet"`
	Verbose bool   `yaml:"verbose"`

	// Core policy configuration (fields from grant.Policy but without omitempty for booleans)
	Allow               []string `yaml:"allow,omitempty"`
	IgnorePackages      []string `yaml:"ignore-packages"`
	RequireLicense      bool     `yaml:"require-license"`
	RequireKnownLicense bool     `yaml:"require-known-license"`

	// Command-specific options
	DisableFileSearch bool `yaml:"disable-file-search"`
	Summary           bool `yaml:"summary"`
	OnlyUnlicensed    bool `yaml:"only-unlicensed"`
}

FullConfig represents all possible configuration options for Grant This struct combines policy options with CLI options that can be set in config

type GlobalConfig added in v0.3.0

type GlobalConfig struct {
	ConfigFile   string
	OutputFormat string
	OutputFile   string
	Quiet        bool
	Verbose      bool
	NoOutput     bool
}

GlobalConfig holds configuration that applies to all commands

func GetGlobalConfig added in v0.3.0

func GetGlobalConfig(cmd *cobra.Command) *GlobalConfig

GetGlobalConfig extracts global configuration from cobra command

Jump to

Keyboard shortcuts

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