args

package
v0.0.0-...-e401c93 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AppNameArg = AvailableArgument{
		Parameter:   "name",
		Description: "Set the name of the project",
		Argument:    "<string>",
	}
	LicenseArg = AvailableArgument{
		Parameter:   "license",
		Description: "Set the license of the project",
		Argument:    "<string>",
	}
	YearArg = AvailableArgument{
		Parameter:   "year",
		Description: "Set the year",
		Argument:    "<int|string>",
	}
	AuthorsArg = AvailableArgument{
		Parameter:   "authors",
		Description: "Set the authors of the project, separate them with the coma (,)",
		Argument:    "[string,]",
	}
	ConfigPath = AvailableArgument{
		Parameter:   "config-path",
		Description: "Set a path to the config for using custom licenses",
		Argument:    "string",
	}
	HelpArg = InfoArgument{
		Parameter: "h",

		Description: "Show the help",
		// contains filtered or unexported fields
	}
	LicenseListArg = InfoArgument{
		Parameter: "l",

		Description: "List every available license",
		// contains filtered or unexported fields
	}
	VerboseArg = OtherArgument{
		Parameter:   "v",
		Description: "Verbose mode",
	}
)
View Source
var (
	Name             string
	LicenseSelected  string
	Authors          string
	Years            string
	CustomConfigPath string
	Help             bool
	List             bool
	Verbose          bool
)

Functions

func AddLicense

func AddLicense(license *License, name string)

Types

type Arguments

type Arguments struct {
	AppName     string
	LicenseType *License
	Years       string
	Authors     []string
	ConfigPath  string
	Question    bool
	Info        bool
	InfoText    func() string
}

func ParseCliArgs

func ParseCliArgs() *Arguments

func (*Arguments) HandleArgs

func (arg *Arguments) HandleArgs()

type AvailableArgument

type AvailableArgument struct {
	Parameter   string
	Description string
	Argument    string
}

func (*AvailableArgument) GenerateParameter

func (arg *AvailableArgument) GenerateParameter() string

GenerateParameter Generate the full parameter

type InfoArgument

type InfoArgument struct {
	Parameter string

	Description string
	// contains filtered or unexported fields
}

func (*InfoArgument) GenerateParameter

func (arg *InfoArgument) GenerateParameter() string

func (*InfoArgument) GenerateText

func (arg *InfoArgument) GenerateText() string

type License

type License struct {
	Name string
	File string
}

func GetLicense

func GetLicense(name string) (*License, bool)

type OtherArgument

type OtherArgument struct {
	Parameter   string
	Description string
}

func (*OtherArgument) GenerateParameter

func (arg *OtherArgument) GenerateParameter() string

Jump to

Keyboard shortcuts

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