Categorygithub.com/bitmark-inc/getoptions
modulepackage
0.1.1
Repository: https://github.com/bitmark-inc/getoptions.git
Documentation: pkg.go.dev

# README

getoptions

Simple golang getopt function, an approximation of the FreeBSD getopt_long library routine.

Supports forms like:

--help -h --file data --file=data -v -f data -vvvfdata

See the godoc for this module for details.

# Functions

parse options from an arbitrary array of strings Note that the input string slices does not contain any program name.
parse options from OS command-line Return values: program_name - string options - map["option"]=[]string{"value1","value2"} use len(option["verbose"]) to detect a sequence like: -v -v -v the actual value will be options["verbose"] = []string{"", "", ""} arguments - []string (all items not starting with "-" that do not belong to option and everything after --) err - nil if parsing was sucessful.

# Constants

No description provided by the author
No description provided by the author
argument requirements.
argument requirements.
No description provided by the author
argument requirements.
No description provided by the author

# Structs

option structure to represent a single option definition.

# Type aliases

returned options, the Long name is used in this map repeated option values are returned as a string slice.