Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add https://github.com/jessevdk/go-flags to the project list #37

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ func main() {
```

That code generates next output:
```
go run ./main.go --help
```sh
$ go run ./main.go --help
Usage of _obj/exe/main:
-http-host value
HTTP host (default 127.0.0.1)
Expand All @@ -151,7 +151,7 @@ exit status 2

The flag default key string is the struct field name but can be specified in the struct field's tag value.
The "flag" key in the struct field's tag value is the key name, followed by an optional comma and options. Examples:
```
```golang
// Field is ignored by this package.
Field int `flag:"-"`

Expand All @@ -175,9 +175,9 @@ Field int `flag:",deprecated"`
## Options for desc tag
If you specify description in description tag (`desc` by default) it will be used in USAGE section.

```
```golang
Addr string `desc:"HTTP host"`
```
```sh
this description produces something like:
```
-addr value
Expand All @@ -189,7 +189,7 @@ this description produces something like:

## Options for Parse function:

```
```golang
// DescTag sets custom description tag. It is "desc" by default.
func DescTag(val string)

Expand Down Expand Up @@ -226,3 +226,4 @@ func Flatten(val bool)

* https://github.com/jaffee/commandeer
* https://github.com/anacrolix/tagflag
* https://github.com/jessevdk/go-flags