File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package docs
33import (
44 "bytes"
55 "embed"
6+ "fmt"
67 "io"
78 "io/fs"
89 "net/mail"
@@ -62,6 +63,11 @@ func buildExtendedTestCommand() *cli.Command {
6263 Name : "hidden-flag" ,
6364 Hidden : true ,
6465 },
66+ & cli.StringFlag {
67+ Name : "dir" ,
68+ Value : pwd (),
69+ DefaultText : "$PWD" ,
70+ },
6571 },
6672 Commands : []* cli.Command {{
6773 Aliases : []string {"c" },
@@ -182,6 +188,14 @@ func TestToTabularMarkdown(t *testing.T) {
182188 })
183189}
184190
191+ func pwd () string {
192+ pwd , err := os .Getwd ()
193+ if err != nil {
194+ fmt .Println (err )
195+ }
196+ return pwd
197+ }
198+
185199func TestToTabularMarkdownFailed (t * testing.T ) {
186200 tpl := MarkdownTabularDocTemplate
187201 t .Cleanup (func () { MarkdownTabularDocTemplate = tpl })
Original file line number Diff line number Diff line change 88
99```
1010[--another-flag|-b]
11+ [--dir]=[value]
1112[--flag|--fl|-f]=[value]
1213[--socket|-s]=[value]
1314```
@@ -26,6 +27,8 @@ app [first_arg] [second_arg]
2627
2728** --another-flag, -b** : another usage text
2829
30+ ** --dir** ="": (default: $PWD)
31+
2932** --flag, --fl, -f** ="":
3033
3134** --socket, -s** ="": some 'usage' text (default: value)
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ Global flags:
1919| ` --socket="…" ` (` -s ` ) | some 'usage' text | ` value ` | * none* |
2020| ` --flag="…" ` (` --fl ` , ` -f ` ) | | | * none* |
2121| ` --another-flag ` (` -b ` ) | another usage text | ` false ` | ` EXAMPLE_VARIABLE_NAME ` |
22+ | ` --dir="…" ` | | ` $PWD ` | * none* |
2223
2324### ` config ` command (aliases: ` c ` )
2425
You can’t perform that action at this time.
0 commit comments