option

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2019 License: BSD-2-Clause, BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package option implements simple command-line option parsing.

Index

Constants

View Source
const OptionTerminator = "--"

OptionTerminator is the string, when seen on the command line, which terminates further option processing.

Variables

View Source
var OptionTypeMap = map[string]string{"s": "string", "i": "int", "u": "uint", "f": "float", "b": "bool"}

OptionTypeMap is the map of recognized type abbreviations to types.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name       string
	Definition string
	Flags      int
}

Config is {TODO}.

type Options

type Options struct {
	Definitions []Config
}

Options is {TODO}.

func NewParser

func NewParser() Options

NewParser returns {TODO}.

func (*Options) Add

func (optDef *Options) Add(name, def string)

Add adds a new option definition.

func (Options) Parse

func (optDef Options) Parse(args []string) (ParsedOptionsMap, []string, error)

Parse returns {TODO}.

func (Options) ParseCommandLine

func (optDef Options) ParseCommandLine() (ParsedOptionsMap, []string, error)

ParseCommandLine returns {TODO}.

type ParsedOptionsMap

type ParsedOptionsMap map[string]interface{}

ParsedOptionsMap is {TODO}.

Jump to

Keyboard shortcuts

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