summaryrefslogtreecommitdiff
path: root/usage.go
AgeCommit message (Collapse)Author
10 daysnotsureJeff Carr
2025-09-24rearrangeJeff Carr
2024-09-05Merge pull request #262 from hhromic/fix-261Alex Flint
Fix help text for positional args with default and env var
2024-07-22Fix help text for positional args with default and env varHugo Hromic
2024-07-06Move writing program version from usage to help writerHugo Hromic
* Writing the version on usage text is unexpected and confusing
2024-06-30Merge pull request #224 from hhromic/better-version-v2Alex Flint
Fix usage writing when using custom version flag
2024-06-29Implement scanning of version flag in specs for usage generationHugo Hromic
2024-06-29Better scanning of version flag in specs for help generationHugo Hromic
2024-06-29Use standard exit status code for usage errorsHugo Hromic
* The stdlib `flags` package and most command line utilities use status code `2`.
2024-04-02Merge pull request #243 from alexflint/handle-empty-placeholderv1.5.0Alex Flint
Handle explicit empty placeholders
2024-03-31handle explicit empty placeholdersAlex Flint
2023-10-08add subcommand aliasesAlex Flint
2023-07-14Improve handling of version flagHugo Hromic
* Only use/show builtin `--version` flag if args are versioned with a non-empty `Version()` * If args define a `--version` flag, honor it and disable/hide the builtin version flag * Only return `ErrVersion` when using the builtin version flag
2023-06-03help,usage and error messages and testsIlja Neumann
2023-06-03don't print env-vars in usage lineIlja Neumann
2023-06-03fixed testsPablo Diaz
2023-06-03added tests and fixed usagePablo Diaz
2023-02-08clean up customizable stdout, stderr, and exit in parser configAlex Flint
2023-02-08feat: support more env than terminalduxinlong
Change-Id: I7f35e90b8f19f4ea781832885d35e2f1e275207a
2022-10-29Merge remote-tracking branch 'origin/master' into default-value-issueAlex Flint
2022-10-29add test for the new default value parsing logic as it shows up in help messagesAlex Flint
2022-09-17Feat: Add epilog after help textSebastiaan Pasterkamp
Similar to the Description at the top of the help text an Epilog is added at the bottom. Resolves #189
2022-02-09fix bracketing for non-required positionalsAlex Flint
2021-05-09simplify the error string logicAlex Flint
2021-05-09add FailSubcommand, WriteUsageForSubcommand, WriteHelpForSubcommandAlex Flint
2021-04-19test coverage 100% !!Alex Flint
2021-04-19change "kind" to "cardinality", add support for maps to parserAlex Flint
2021-04-16Merge pull request #137 from alexflint/optional-longAlex Flint
Optional long names
2021-04-08refactor: remove unused functionLeoZhan
2021-01-31test that short-only options are printed first in the help messageAlex Flint
2020-12-20Skip right column if the left is emptyAndrew Morozko
2020-12-20Optional long argumentsAndrew Morozko
2020-06-03feat(usage): Include env variable in usageDenys Vitali
2020-01-25Fix lint warningsDylan Allbee
2020-01-25Use command passed into p.Parse(...) write methodsDylan Allbee
It is currently impossible to programatically write help and usage messages for subcommands, due to parser.WriteHelp and parser.WriteUsage not taking the state of the parser into account. Check for the existence of p.lastCmd and use it for the writers when available. Enables ability to write unit tests for subcommand help.
2020-01-25Print global options in help for subcommandsDylan Allbee
fixes #101
2020-01-23address review commentsMarco Molteni
2020-01-19usage: if the program supports subcommands, mention itMarco Molteni
2019-11-30Various changesAndrew Morozko
2019-11-29Added the "dataname" tagAndrew Morozko
2019-10-19store default values during NewParserAlex Flint
2019-05-03no need to initialize nil structs during path traversalAlex Flint
2019-05-03simplify Fprint callAlex Flint
2019-05-03print help and usage at subcommand level if necessaryAlex Flint
2019-05-03add subcommands to usage stringAlex Flint
2019-04-30introduced path structAlex Flint
2019-04-30rename get/settable to readable/writableAlex Flint
2019-04-30minor reformatAlex Flint
2019-04-14all tests passing againAlex Flint
2019-04-14refactor validationAlex Flint