flag

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ID          = "id"
	IDAlias     = []string{"i"}
	Page        = "page"
	PageAlias   = []string{"p"}
	Raw         = "raw"
	RawAlias    = []string{"r"}
	Type        = "type"
	TypeAlias   = []string{"t"}
	Status      = "status"
	StatusAlias = []string{"s"}
	Season      = "season"
	SeasonAlias = []string{"s"}
	Year        = "year"
	YearAlias   = []string{"y"}
	Tag         = "tag"
	TagAlias    = []string{"t"}
	Sort        = "sort"
	SortAlias   = []string{"s"}
	Output      = "out"
	OutputPath  = "out-path"
	OutputAlias = []string{"o"}
)

Flag keys and aliases.

View Source
var Bool = map[string]*cli.BoolFlag{
	Raw: {
		Name:    Raw,
		Aliases: RawAlias,
		Usage:   "Print raw JSON without indentation",
		Value:   false,
	},
	Output: {
		Name:    Output,
		Aliases: OutputAlias,
		Usage:   "Put the result to a file",
		Value:   false,
	},
}

Bool is flag list for boolean value.

View Source
var DefaultOutput = os.Getenv("GOPATH") + "/mal.json"

DefaultOutput is default cli output file path.

View Source
var Int = map[string]*cli.IntFlag{
	ID: {
		Name:     ID,
		Aliases:  IDAlias,
		Usage:    "MyAnimeList id",
		Required: true,
	},
	Page: {
		Name:    Page,
		Aliases: PageAlias,
		Usage:   "Page number",
		Value:   1,
	},
	Status: {
		Name:    Status,
		Aliases: StatusAlias,
		Usage:   "Anime/manga status",
		Value:   7,
	},
	Year: {
		Name:    Year,
		Aliases: YearAlias,
		Usage:   "Season year",
		Value:   time.Now().Year(),
	},
	Type: {
		Name:    Type,
		Aliases: TypeAlias,
		Usage:   "List type",
	},
	Sort: {
		Name:    Sort,
		Aliases: SortAlias,
		Usage:   "Sorting",
		Value:   2,
	},
}

Int is flag list for integer value.

View Source
var Str = map[string]*cli.StringFlag{
	Type: {
		Name:    Type,
		Aliases: TypeAlias,
		Usage:   "Media type (either anime or manga)",
	},
	Season: {
		Name:    Season,
		Aliases: SeasonAlias,
		Usage:   "Season name (winter, fall, spring or summer)",
		Value:   utils.GetCurrentSeason(),
	},
	Tag: {
		Name:    Tag,
		Aliases: TagAlias,
		Usage:   "Category tags",
	},
	OutputPath: {
		Name:  OutputPath,
		Usage: "Output file path",
		Value: DefaultOutput,
	},
}

Str is flag list for string value.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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