From c50cf987953c6a00511d9e25442a0455d4efb62e Mon Sep 17 00:00:00 2001 From: Fabio Bonelli Date: Thu, 12 Nov 2026 15:16:09 +0000 Subject: [PATCH] fix: name the path argument dir in CLI help --- publiccode-parser/publiccode_parser.go | 4 ++-- publiccode-parser/publiccode_parser_test.go | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/publiccode-parser/publiccode_parser.go b/publiccode-parser/publiccode_parser.go index 8a4d6e3..9768bdf 100644 --- a/publiccode-parser/publiccode_parser.go +++ b/publiccode-parser/publiccode_parser.go @@ -51,8 +51,8 @@ func run(args []string, stdout, stderr io.Writer) int { } localBasePathPtr := flags.String( "path", "", - "Use this local directory as base path when checking for files existence "+ - "instead of using the `url` key in publiccode.yml", + "Use this local `dir` as base path when checking for files existence "+ + "instead of using the url key in publiccode.yml", ) disableNetworkPtr := flags.Bool( "no-network", false, diff --git a/publiccode-parser/publiccode_parser_test.go b/publiccode-parser/publiccode_parser_test.go index 750b643..6420832 100644 --- a/publiccode-parser/publiccode_parser_test.go +++ b/publiccode-parser/publiccode_parser_test.go @@ -143,12 +143,16 @@ func TestRunNoArgumentPrintsUsageOnStderr(t *testing.T) { } func TestRunHelpPrintsUsageOnStdout(t *testing.T) { - _, stdout, stderr := runCLI(t, "-help") + _, stdout, stderr := runCLI(t, "--help") if !strings.HasPrefix(stdout, "Usage: publiccode-parser") { t.Errorf("expected the usage on stdout, got %q", stdout) } + if !strings.Contains(stdout, " -path dir\n") { + t.Errorf("expected the path value to be named dir, got %q", stdout) + } + if stderr != "" { t.Errorf("expected no output on stderr, got %q", stderr) }