Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrVersion = errors.New("version requested")
Functions ¶
This section is empty.
Types ¶
type Opts ¶
type Opts struct { // GemOptions contains options for goldmark-gemtext. GemOptions []gem.Option // Names of files to convert. Names []string // Output specifies where to write gemtext files. // If output is blank gemtext files will be written in the source folder. Output string // TemplateArgs is an even slice of strings. // Every even string (starting at 0) should be a regular expression for // matching input filenames. Every odd string should be a filepath to a // loadable template file. // TemplateArgs should be parsed into a matchedTemplates. TemplateArgs []string }
Opts represents options selected from command line flags.
func ParseArgs ¶
ParseArgs parses the command-line arguments provided to the program. Typically os.Args[0] is provided as 'progname' and os.Args[1:] as 'args'. Returns Opts in case parsing succeeded, or an error. In any case, the usage text of the flag.Parse is returned. A special case is usage requests with -h or -help: then the error flag.ErrHelp is returned and output will contain the usage message. Another special case is version in which the error will be ErrVersion.
Click to show internal directories.
Click to hide internal directories.