options

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

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

func ParseArgs(progname string, args []string) (*Opts, string, error)

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.

Jump to

Keyboard shortcuts

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