Skip to content

feat: add Usage option for custom help message in Flagrun - #28

Merged
kazeburo merged 1 commit into
mainfrom
feat/usage-option
Sep 10, 2026
Merged

feat: add Usage option for custom help message in Flagrun#28
kazeburo merged 1 commit into
mainfrom
feat/usage-option

Conversation

@kazeburo

@kazeburo kazeburo commented Sep 10, 2026

Copy link
Copy Markdown
Member

PR Type

Enhancement, Tests, Documentation


Description

  • Add configurable parser usage text option

  • Preserve required-arguments usage as default

  • Test custom usage in help output

  • Document Usage configuration behavior


Diagram Walkthrough

flowchart LR
  Config["flagrun.Usage option"]
  Parser["Go flags parser"]
  Help["Custom help usage output"]
  Config -- "sets `Usage`" --> Parser
  Parser -- "renders" --> Help
Loading

File Walkthrough

Relevant files
Enhancement
flagrun.go
Add configurable parser usage text                                             

flagrun.go

  • Add Usage field to Flagrun.
  • Add Usage(string) functional option.
  • Apply custom usage to the parser when provided.
  • Retain required-arguments usage only without custom text.
+11/-1   
Tests
flagrun_go_test.go
Test custom usage help output                                                       

flagrun_go_test.go

  • Add help-output test for Usage.
  • Verify custom usage is written to stdout.
  • Confirm help exits with OK.
+16/-0   
Documentation
README.md
Document configurable usage option behavior                           

README.md

  • Document the flagrun.Usage option.
  • Explain its default and ArgsRequired interaction.
+1/-0     

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected

@github-actions

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

No code suggestions found for the PR.

@kazeburo
kazeburo merged commit 3fc55e4 into main Sep 10, 2026
3 checks passed
@kazeburo
kazeburo deleted the feat/usage-option branch September 10, 2026 13:43
@github-actions github-actions Bot mentioned this pull request Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant