Skip to content

Commit 2b003b7

Browse files
authored
Merge pull request #34 from urfave/examples
Fix links to examples
2 parents 2080286 + ae1911c commit 2b003b7

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

README.md

+25-25
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Flags based on structures. [![GoDoc](https://godoc.org/github.com/octago/sflags?status.svg)](http://godoc.org/github.com/octago/sflags) [![Build Status](https://travis-ci.org/octago/sflags.svg?branch=master)](https://travis-ci.org/octago/sflags) [![codecov](https://codecov.io/gh/octago/sflags/branch/master/graph/badge.svg)](https://codecov.io/gh/octago/sflags) [![Go Report Card](https://goreportcard.com/badge/github.com/octago/sflags)](https://goreportcard.com/report/github.com/octago/sflags)
1+
# Flags based on structures [![GoDoc](https://godoc.org/github.com/octago/sflags?status.svg)](http://godoc.org/github.com/octago/sflags) [![Build Status](https://travis-ci.org/octago/sflags.svg?branch=master)](https://travis-ci.org/octago/sflags) [![codecov](https://codecov.io/gh/octago/sflags/branch/master/graph/badge.svg)](https://codecov.io/gh/octago/sflags) [![Go Report Card](https://goreportcard.com/badge/github.com/octago/sflags)](https://goreportcard.com/report/github.com/octago/sflags)
22

33
The sflags package uses structs, reflection and struct field tags
44
to allow you specify command line options. It supports [different types](#supported-types-in-structures) and [features](#features).
@@ -21,14 +21,28 @@ type Config struct {
2121

2222
And you can use your favorite flag or cli library!
2323

24-
## Supported flags and cli libraries:
24+
## Supported libraries and features:
2525

26-
- [x] [flag](https://golang.org/pkg/flag/) - [example](https://github.com/octago/sflags/blob/master/examples/flag/main.go)
27-
- [x] [spf13/pflag](https://github.com/spf13/pflag) - [example](https://github.com/octago/sflags/blob/master/examples/pflag/main.go)
28-
- [x] [spf13/cobra](https://github.com/spf13/cobra) - [example](https://github.com/octago/sflags/blob/master/examples/cobra/main.go)
29-
- [ ] [spf13/viper](https://github.com/spf13/viper)
30-
- [x] [urfave/cli](https://github.com/urfave/cli) [example](https://github.com/octago/sflags/blob/master/examples/urfave_cli/main.go)
31-
- [x] [kingpin](https://github.com/alecthomas/kingpin) [example](https://github.com/octago/sflags/blob/master/examples/kingpin/main.go)
26+
| | | Hidden | Deprecated | Short | Env |
27+
| --- | --- | ------ | ---------- |------ | --- |
28+
| <ul><li>[x] [flag]</li><ul> | [example](./examples/flag/main.go) | `-` | `-` | `-` | `-` |
29+
| <ul><li>[x] [kingpin]</li></ul> | [example](./examples/kingpin/main.go) | <ul><li>[x] </li></ul> | <ul><li>[ ] </li></ul> | <ul><li>[x] </li></ul> | <ul><li>[x] </li></ul> |
30+
| <ul><li>[x] [spf13/pflag]</li></ul> | [example](./examples/pflag/main.go) | <ul><li>[x] </li></ul> | <ul><li>[x] </li></ul> | <ul><li>[x] </li></ul> | `-` |
31+
| <ul><li>[x] [spf13/cobra]</li></ul> | [example](./examples/cobra/main.go) | <ul><li>[x] </li></ul> | <ul><li>[x] </li></ul> | <ul><li>[x] </li></ul> | `-` |
32+
| <ul><li>[ ] [spf13/viper]</li><ul> | | <ul><li>[ ] </li></ul> | <ul><li>[ ] </li></ul> | <ul><li>[ ] </li></ul> | <ul><li>[ ] </li></ul> |
33+
| <ul><li>[x] [urfave/cli]</li></ul> | [example](./example/urfave_cli/main.go) | <ul><li>[x] </li></ul> | `-` | <ul><li>[x] </li></ul> | <ul><li>[x] </li></ul> |
34+
35+
- [x] - feature is supported and implemented
36+
37+
`-` - feature can't be implemented for this cli library
38+
39+
40+
[flag]: https://golang.org/pkg/flag/
41+
[spf13/pflag]: https://github.com/spf13/pflag
42+
[spf13/cobra]: https://github.com/spf13/cobra
43+
[spf13/viper]: https://github.com/spf13/viper
44+
[urfave/cli]: https://github.com/urfave/cli
45+
[kingpin]: https://github.com/alecthomas/kingpin
3246

3347
## Features:
3448

@@ -74,22 +88,10 @@ And you can use your favorite flag or cli library!
7488
- [ ] url list
7589
- [ ] units (bytes 1kb = 1024b, speed, etc)
7690

77-
## Supported features matrix:
91+
## Example:
7892

79-
| Name | Hidden | Deprecated | Short | Env |
80-
| --- | --- | --- | --- | --- |
81-
| flag | - | - | - | - |
82-
| pflag | [x] | [x] | [x] | - |
83-
| kingpin | [x] | [ ] | [x] | [x] |
84-
| urfave | [x] | - | [x] | [x] |
85-
| cobra | [x] | [x] | [x] | - |
86-
| viper | [ ] | [ ] | [ ] | [ ] |
87-
88-
\[x] - feature is supported and implemented
89-
90-
`-` - feature can't be implemented for this cli library
91-
92-
Simple example for flag library:
93+
The code below shows how to use `sflags` with the [flag] library. Examples for other
94+
flag libraries are available from [./examples](./examples) dir.
9395

9496
```golang
9597
package main
@@ -145,8 +147,6 @@ Usage of _obj/exe/main:
145147
exit status 2
146148
```
147149

148-
Look at the other [examples](https://github.com/octago/sflags/blob/master/examples) for different flag libraries.
149-
150150
## Options for flag tag
151151

152152
The flag default key string is the struct field name but can be specified in the struct field's tag value.

0 commit comments

Comments
 (0)