positional args without allcmd.ArgsRequired help print dependent from arg.Required
diff --git a/help.go b/help.go
index 068fce1..bbf764b 100644
--- a/help.go
+++ b/help.go
@@ -334,7 +334,11 @@
}
if !allcmd.ArgsRequired {
- fmt.Fprintf(wr, "[%s]", name)
+ if arg.Required > 0 {
+ fmt.Fprintf(wr, "%s", name)
+ } else {
+ fmt.Fprintf(wr, "[%s]", name)
+ }
} else {
fmt.Fprintf(wr, "%s", name)
}
diff --git a/help_test.go b/help_test.go
index ba75c7a..27c3d0e 100644
--- a/help_test.go
+++ b/help_test.go
@@ -107,7 +107,7 @@
if runtime.GOOS == "windows" {
expected = `Usage:
- TestHelp [OPTIONS] [filename] [num] [hidden-in-help] <bommand | command | parent>
+ TestHelp [OPTIONS] [filename] [num] hidden-in-help <bommand | command | parent>
Application Options:
/v, /verbose Show verbose debug information
@@ -156,7 +156,7 @@
`
} else {
expected = `Usage:
- TestHelp [OPTIONS] [filename] [num] [hidden-in-help] <bommand | command | parent>
+ TestHelp [OPTIONS] [filename] [num] hidden-in-help <bommand | command | parent>
Application Options:
-v, --verbose Show verbose debug information