Documentation ¶
Index ¶
Constants ¶
const AppName = "pkgdmp"
AppName is the name of the CLI application.
Variables ¶
var ( // ErrNoDirs is returned by [ParseFlags] if args contain no directories. ErrNoDirs = errors.New("no directories in command line arguments") // ErrVersion is returned by [ParseFlags] if the -version flag is specified. ErrVersion = errors.New("version") )
Functions ¶
func BuildCommit ¶
func BuildCommit() string
BuildCommit returns the git commit hash pkgdmp was built from.
Returns `HEAD` if no build commit is set.
func BuildGoVersion ¶
func BuildGoVersion() string
BuildGoVersion returns the go version pkgdmp was built with.
Returns version from runtime.Version if not set.
func BuildTime ¶
func BuildTime() string
BuildTime returns the UTC time pkgdmp was built.
Returns current time in UTC if not set.
func ParserOptsFromCfg ¶
func ParserOptsFromCfg(cfg *Config) ([]pkgdmp.ParserOption, error)
ParserOptsFromCfg constructs parser options from CLI configuration.
Types ¶
type Config ¶
type Config struct { ExcludePackages string Only string ExcludeMatching string Theme string Matching string OnlyPackages string Exclude string Dirs []string `env:"skip"` NoDocs bool NoTags bool NoHighlight bool FullDocs bool Unexported bool Version bool `env:"skip"` NoEnv bool `env:"skip"` JSON bool // contains filtered or unexported fields }
Config represents CLI configuration from flags.
func ParseFlags ¶
ParseFlags parses command line arguments as flags and returns a CLI configuration together with exit code to use if error is also returned.
func (*Config) IncludePackage ¶ added in v0.3.0
IncludePackage returns true if package with provided name should be included in the report according to configuration, or false otherwise.