flags

package
v0.0.0-...-680e691 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind

func Bind(out interface{}, args []string) error

Bind 解析并绑定参数,有flag标记的tag使用可选参数,否则安顺序绑定参数

func Parse

func Parse(args []string) ([]string, map[string][]string, error)

Parse 类似官方flag,解析CommandLine生成必须参数和可选参数 1:-表示shortcut,可以多个合并,例如,-h 表示help, -czvx,表示-c -z -v -x,如果带参数,则只会设置给最后一个 2:--表示全称,例如--help 3:后边可以紧跟一个参数,可以使用=连载一起写,也可以空格分隔 4:可以重复,相同的则合并成1个处理

https://github.com/simonleung8/flags https://github.com/jessevdk/go-flags

Types

This section is empty.

Jump to

Keyboard shortcuts

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