File tree Expand file tree Collapse file tree 1 file changed +0
-51
lines changed Expand file tree Collapse file tree 1 file changed +0
-51
lines changed Original file line number Diff line number Diff line change @@ -230,57 +230,6 @@ That flag can then be set with `--lang spanish` or `-l spanish`. Note that
230
230
giving two different forms of the same flag in the same command invocation is an
231
231
error.
232
232
233
- #### Grouping
234
-
235
- You can associate a category for each flag to group them together in the help output, e.g:
236
-
237
- ``` go
238
- package main
239
-
240
- import (
241
- " log"
242
- " os"
243
-
244
- " github.com/urfave/cli/v2"
245
- )
246
-
247
- func main () {
248
- app = &cli.App {
249
- Flags: []cli.Flag {
250
- &cli.BoolFlag {
251
- Name: " silent" ,
252
- Aliases: []string {" s" },
253
- Usage: " no messages" ,
254
- Category: " Miscellaneous:" ,
255
- },
256
- &cli.BoolFlag {
257
- Name: " perl-regexp" ,
258
- Aliases: []string {" P" },
259
- Usage: " PATTERNS are Perl regular expressions" ,
260
- Category: " Pattern selection:" ,
261
- },
262
- },
263
- }
264
-
265
- if err := app.Run (os.Args ); err != nil {
266
- log.Fatal (err)
267
- }
268
- }
269
- ```
270
-
271
- Will result in help output like:
272
-
273
- ```
274
- GLOBAL OPTIONS:
275
- Miscellaneous:
276
-
277
- --silent, -s no messages (default: false)
278
-
279
- Pattern selection:
280
-
281
- --perl-regexp, -P PATTERNS are Perl regular expressions (default: false)
282
- ```
283
-
284
233
#### Ordering
285
234
286
235
Flags for the application and commands are shown in the order they are defined.
You can’t perform that action at this time.
0 commit comments