From c7e4687dfb1415efb575e855beb508de671cf36f Mon Sep 17 00:00:00 2001 From: Virgil Date: Wed, 1 Apr 2026 21:47:22 +0000 Subject: [PATCH] feat(build): surface workflow output alias in help text Co-Authored-By: Virgil --- cmd/build/cmd_workflow.go | 2 +- cmd/build/cmd_workflow_test.go | 10 ++++++++-- locales/en.json | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/cmd/build/cmd_workflow.go b/cmd/build/cmd_workflow.go index 4125c82..b3c04fa 100644 --- a/cmd/build/cmd_workflow.go +++ b/cmd/build/cmd_workflow.go @@ -32,7 +32,7 @@ func setWorkflowI18n() { func initWorkflowFlags() { releaseWorkflowCmd.Flags().StringVar(&releaseWorkflowPath, "path", "", i18n.T("cmd.build.workflow.flag.path")) - releaseWorkflowCmd.Flags().StringVar(&releaseWorkflowOutputPath, "output", "", i18n.T("cmd.build.workflow.flag.path")) + releaseWorkflowCmd.Flags().StringVar(&releaseWorkflowOutputPath, "output", "", i18n.T("cmd.build.workflow.flag.output")) } // AddWorkflowCommand registers the release workflow generation subcommand. diff --git a/cmd/build/cmd_workflow_test.go b/cmd/build/cmd_workflow_test.go index 3c4d16f..f001480 100644 --- a/cmd/build/cmd_workflow_test.go +++ b/cmd/build/cmd_workflow_test.go @@ -33,8 +33,14 @@ func TestBuildCmd_RunReleaseWorkflow_Good(t *testing.T) { buildCmd := &cli.Command{Use: "build"} AddWorkflowCommand(buildCmd) - assert.NotNil(t, releaseWorkflowCmd.Flags().Lookup("path")) - assert.NotNil(t, releaseWorkflowCmd.Flags().Lookup("output")) + pathFlag := releaseWorkflowCmd.Flags().Lookup("path") + outputFlag := releaseWorkflowCmd.Flags().Lookup("output") + + assert.NotNil(t, pathFlag) + assert.NotNil(t, outputFlag) + assert.NotEmpty(t, pathFlag.Usage) + assert.NotEmpty(t, outputFlag.Usage) + assert.NotEqual(t, pathFlag.Usage, outputFlag.Usage) }) t.Run("writes to a custom relative path", func(t *testing.T) { diff --git a/locales/en.json b/locales/en.json index 68a9503..b08bf01 100644 --- a/locales/en.json +++ b/locales/en.json @@ -115,7 +115,8 @@ "short": "Generate the release workflow", "long": "Write the embedded GitHub Actions release workflow into .github/workflows/release.yml or a custom path.", "flag": { - "path": "Output path for the workflow file" + "path": "Output path for the workflow file", + "output": "Alias for --path." } }, "sdk": {