Commit Graph

410 Commits

Author SHA1 Message Date
Jeff Carr 3d847431ab dump go.mod and go.sum 2024-11-07 16:55:05 -06:00
Jeff Carr f92d210ca7 Merge remote-tracking branch 'flint/master' into jcarr
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-11-07 12:48:14 -06:00
Alex Flint 438bbfff1e
Merge pull request #258 from hhromic/implement-204
Add support for setting a global env var prefix
2024-11-04 12:58:37 -05:00
Alex Flint efb1be7122
Merge pull request #273 from alexflint/pass-dash-dash-through
Passing the no-more-options string "--" twice or more
2024-11-04 12:56:12 -05:00
Alex Flint 51d9bef113 passing the no-more-options string "--" twice or more should pass the second and subsequent ones through as positionals 2024-10-21 17:08:37 -04:00
Hugo Hromic cb7e5c1905
Add global env prefix example to README
* Also made newline separations around sections consistent
* Also fixed usage of `p.Parse()` in env variable ignore example
2024-09-07 13:07:21 +01:00
Hugo Hromic 9b5c76b1c4
Add support for setting a global env var prefix 2024-09-07 12:19:10 +01:00
Alex Flint b218ad854d
Merge pull request #271 from alexflint/update-funding
Update FUNDING.yml
2024-09-06 09:00:31 -04:00
Alex Flint dcb5577c2b
Update FUNDING.yml 2024-09-06 09:00:13 -04:00
Alex Flint d10a064207
Merge pull request #262 from hhromic/fix-261
Fix help text for positional args with default and env var
2024-09-05 17:20:09 -04:00
Alex Flint a5045bbe85
Merge pull request #259 from hhromic/fix-193
Move writing program version from usage to help writer
2024-09-05 17:19:12 -04:00
Alex Flint 3925edf11a
Merge pull request #270 from alexflint/parse-docs
Update API docs for Parser.Parse
2024-09-05 17:17:34 -04:00
Alex Flint 12fffac1d8 field -> fields 2024-09-05 17:16:23 -04:00
Alex Flint b13a62172a update api docs for Parser.Parse 2024-09-05 17:15:02 -04:00
Alex Flint 7cf32414af
Merge pull request #269 from alexflint/sponsorship
Living in a monastery; looking for funding
2024-09-05 17:06:35 -04:00
Alex Flint bdb7560b8d
Living in a monastery looking for funding
The first commit to this project was on October 31, 2015, almost 9 years ago. It was [268 lines of code](408290f7c2) and it worked pretty well! That was just about three and a half years after Go 1.0 was released. What fun!

At that time there was no Go module system, so there was no need for versioned releases. Later, I started releasing official versions from time to time. v1.0.0 was published in December 2018.

Over the years I've resisted adding a lot of features, and as a result the library is in pretty good shape. I use it in almost every Go program I write, personally, both servers/daemons and command line tools. It's nice!

I live in a Buddhist monastery in Vermont now, not as a monk but as a lay practitioner. I'm working on building a form of Buddhism fit for consumption by AI systems. I love maintaining this little piece of software and I'd love some financial support to do so. I don't have a day job, and I need money to buy firewood, pay for car insurance, and travel to see my folks back home in Australia from time to time.

If you use go-arg please consider sponsoring me. It would make a huge difference to me, and it will create a connection between us. I look forward to many long relationships.
2024-09-05 17:05:51 -04:00
Alex Flint 50166cae2c
Merge pull request #268 from alexflint/readme-custom-error-handling
Add info to README about programmatically reproducing behavior of MustParse
2024-09-04 10:31:40 -04:00
Alex Flint 7fd624cf1c add info to README about programmatically reproducing behavior of MustParse 2024-09-04 10:27:34 -04:00
Hugo Hromic bf156d17a3
Fix help text for positional args with default and env var 2024-07-22 19:25:51 +01:00
Hugo Hromic 3673177bf9
Move writing program version from usage to help writer
* Writing the version on usage text is unexpected and confusing
2024-07-06 11:52:47 +01:00
Alex Flint 3de7278c4f
Merge pull request #257 from hhromic/fix-testable-example
Fix testable example output comment formatting
2024-07-04 12:40:29 -04:00
Hugo Hromic b8282df4c4
Fix testable example output comment formatting 2024-06-30 23:46:34 +01:00
Alex Flint ec0ced7467
Merge pull request #232 from alexflint/bump-go-versions
bump go versions used in CI
2024-06-30 16:42:12 -04:00
Alex Flint 0cc152dce5
Merge pull request #224 from hhromic/better-version-v2
Fix usage writing when using custom version flag
2024-06-30 12:27:39 -04:00
Alex Flint 67353a8bcf
Update version of github actions 2024-06-30 10:35:08 -04:00
Alex Flint af368523db
Update go.yml 2024-06-30 10:33:03 -04:00
Alex Flint b6422dcbc3
Merge pull request #233 from testwill/typo
fix: typo
2024-06-30 10:32:09 -04:00
Alex Flint 56ee7c97ac
Merge pull request #237 from purpleidea/feat/env-docs
add an example for environment vars with arg names
2024-06-30 10:31:46 -04:00
Alex Flint 177b84441e
Merge pull request #256 from hhromic/fix-246
Use standard exit status code for usage errors
2024-06-30 10:31:00 -04:00
Hugo Hromic c087d71802
Add note for version flag overriding to README 2024-06-30 00:13:28 +01:00
Hugo Hromic c992aa8627
Add more test cases for version help/usage writing 2024-06-30 00:12:34 +01:00
Hugo Hromic bed89eb683
Implement scanning of version flag in specs for usage generation 2024-06-29 23:42:22 +01:00
Hugo Hromic 4ed4ce751f
Better scanning of version flag in specs for help generation 2024-06-29 23:42:22 +01:00
Hugo Hromic a7c40c36a3
Use standard exit status code for usage errors
* The stdlib `flags` package and most command line utilities use status code `2`.
2024-06-29 15:44:50 +01:00
Alex Flint bee5cf5d7c
Merge pull request #255 from hhromic/fix-254
Fix crash on errors in package-level `MustParse`
2024-06-28 11:03:08 -04:00
Hugo Hromic aa844c7de9
Fix crash on errors in package-level `MustParse` 2024-06-27 00:33:09 +01:00
Alex Flint dfca71d159
Merge pull request #243 from alexflint/handle-empty-placeholder
Handle explicit empty placeholders
2024-04-02 12:16:06 -04:00
Alex Flint 188bd31bf6
Merge pull request #244 from alexflint/restore-100pct-coverage
Restore 100% test coverage
2024-04-02 12:14:49 -04:00
Alex Flint 8a917260c3 add a test case with single-level subcommands 2024-04-02 12:10:52 -04:00
Alex Flint 3ddfffdcd3 add test for help and usage when a --version flag is present 2024-04-02 12:05:00 -04:00
Alex Flint 68948b2ac1 restore 100% code coverage 2024-03-31 12:05:26 -04:00
Alex Flint be792f1f8b ping 2024-03-31 11:52:16 -04:00
Alex Flint 8e35a4f0d4 handle explicit empty placeholders 2024-03-31 10:30:12 -04:00
James Shubin 84ddf1d244 add an example for environment vars with arg names
If you want to specify both of these, and if they should have different
names, then this shows you how it can be done.
2024-02-28 22:29:16 -05:00
Jeff Carr 6b16520795 go mod update against scalar
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-14 14:37:17 -06:00
Jeff Carr 0af6f25365 add register()
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-14 14:26:47 -06:00
Jeff Carr 530fcb84d4 isolate tests
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-14 14:25:54 -06:00
guoguangwu 582e6d537a fix: typo
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
2023-11-15 17:58:55 +08:00
Alex Flint bf629a16cb
Merge pull request #231 from alexflint/subcommand-aliases
add subcommand aliases
2023-10-10 18:36:46 -04:00
Alex Flint f02da4cd10 bump go versions used in CI 2023-10-08 20:39:23 -04:00