Skip to content

Commit bdc82a0

Browse files
more tests
1 parent 90e5d23 commit bdc82a0

6 files changed

+15
-5
lines changed

docs_test.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package docs
33
import (
44
"bytes"
55
"embed"
6-
"fmt"
76
"io"
87
"io/fs"
98
"net/mail"
@@ -189,10 +188,7 @@ func TestToTabularMarkdown(t *testing.T) {
189188
}
190189

191190
func pwd() string {
192-
pwd, err := os.Getwd()
193-
if err != nil {
194-
fmt.Println(err)
195-
}
191+
pwd, _ := os.Getwd()
196192
return pwd
197193
}
198194

testdata/expected-doc-full.man

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ greet
1515

1616
.nf
1717
[--another-flag|-b]
18+
[--dir]=[value]
1819
[--flag|--fl|-f]=[value]
1920
[--socket|-s]=[value]
2021

@@ -43,6 +44,9 @@ app [first_arg] [second_arg]
4344
.PP
4445
\fB--another-flag, -b\fP: another usage text
4546

47+
.PP
48+
\fB--dir\fP="": (default: $PWD)
49+
4650
.PP
4751
\fB--flag, --fl, -f\fP="":
4852

testdata/expected-doc-no-authors.md

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ greet
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)

testdata/expected-doc-no-commands.md

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ greet
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)

testdata/expected-doc-no-usagetext.md

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ greet
88

99
```
1010
[--another-flag|-b]
11+
[--dir]=[value]
1112
[--flag|--fl|-f]=[value]
1213
[--socket|-s]=[value]
1314
```
@@ -26,6 +27,8 @@ greet [GLOBAL OPTIONS] [command [COMMAND OPTIONS]] [ARGUMENTS...]
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)

testdata/expected-tabular-markdown-custom-app-path.md

+1
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)