arguments

package
v0.0.0-...-553a8f7 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2019 License: Unlicense Imports: 2 Imported by: 0

Documentation

Overview

Package arguments parse -key=value style command line arguments for package github.com/toy80/utils/options

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extend

func Extend(base, override []string) (z []string)

Extend base with override

func Filter

func Filter(args []string, f func(a string) bool) (dst []string)

Filter args with function f

func IsOption

func IsOption(args string) bool

IsOption reports whether args has prefix "-".

func Key

func Key(args string) *string

Key part of an option args

func KeyValue

func KeyValue(args string) (k, v *string)

KeyValue split an option args into key and value, for example -foo=bar will split into foo and bar. key is empty if args not start with a "-". "--" and "-" are equals. options separated by space (for example -foo bar) is not supported

func Parse

func Parse(src string) (args []string, err error)

Parse command line like string into args

func Value

func Value(args string) *string

Value part of an option args

Types

This section is empty.

Jump to

Keyboard shortcuts

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