File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -133,8 +133,8 @@ func main() {
133133```
134134
135135That code generates next output:
136- ```
137- go run ./main.go --help
136+ ``` sh
137+ $ go run ./main.go --help
138138Usage of _obj/exe/main:
139139 -http-host value
140140 HTTP host (default 127.0.0.1)
@@ -151,7 +151,7 @@ exit status 2
151151
152152The flag default key string is the struct field name but can be specified in the struct field's tag value.
153153The "flag" key in the struct field's tag value is the key name, followed by an optional comma and options. Examples:
154- ```
154+ ``` golang
155155// Field is ignored by this package.
156156Field int ` flag:"-"`
157157
@@ -175,9 +175,9 @@ Field int `flag:",deprecated"`
175175## Options for desc tag
176176If you specify description in description tag (` desc ` by default) it will be used in USAGE section.
177177
178- ```
178+ ``` golang
179179Addr string ` desc:"HTTP host"`
180- ```
180+ ` ` ` sh
181181this description produces something like:
182182` ` `
183183 -addr value
@@ -189,7 +189,7 @@ this description produces something like:
189189
190190## Options for Parse function:
191191
192- ```
192+ ``` golang
193193// DescTag sets custom description tag. It is "desc" by default.
194194func DescTag (val string )
195195
@@ -226,3 +226,4 @@ func Flatten(val bool)
226226
227227 * https:// github.com/jaffee/commandeer
228228 * https:// github.com/anacrolix/tagflag
229+ * https:// github.com/jessevdk/go-flags
You can’t perform that action at this time.
0 commit comments