summaryrefslogtreecommitdiff
path: root/usage_test.go
diff options
context:
space:
mode:
authorHugo Hromic <[email protected]>2024-06-30 23:36:55 +0100
committerHugo Hromic <[email protected]>2024-07-06 11:52:47 +0100
commit3673177bf97072ef223db831b659d2d66cc54a58 (patch)
tree842f03d99193caad180c8c4b83c41cfaf9b9e3b4 /usage_test.go
parent3de7278c4f091f643033f3ebc8fe670c6e7ff7dd (diff)
Move writing program version from usage to help writer
* Writing the version on usage text is unexpected and confusing
Diffstat (limited to 'usage_test.go')
-rw-r--r--usage_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/usage_test.go b/usage_test.go
index a958abb..fc8aaff 100644
--- a/usage_test.go
+++ b/usage_test.go
@@ -237,7 +237,7 @@ func (versioned) Version() string {
}
func TestUsageWithVersion(t *testing.T) {
- expectedUsage := "example 3.2.1\nUsage: example"
+ expectedUsage := "Usage: example"
expectedHelp := `
example 3.2.1
@@ -322,7 +322,7 @@ type subcommand struct {
}
func TestUsageWithVersionAndSubcommand(t *testing.T) {
- expectedUsage := "example 3.2.1\nUsage: example <command> [<args>]"
+ expectedUsage := "Usage: example <command> [<args>]"
expectedHelp := `
example 3.2.1
@@ -353,7 +353,7 @@ Commands:
p.WriteUsage(&usage)
assert.Equal(t, expectedUsage, strings.TrimSpace(usage.String()))
- expectedUsage = "example 3.2.1\nUsage: example cmd [--number NUMBER]"
+ expectedUsage = "Usage: example cmd [--number NUMBER]"
expectedHelp = `
example 3.2.1