Commit Graph

381 Commits

Author SHA1 Message Date
Alex Flint 877176446a
Merge c046f49e12 into bf629a16cb 2023-10-10 21:44:21 -04: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 e7a4f77ed0 add a unittest for an internally messed up subcommand path 2023-10-08 20:24:18 -04:00
Alex Flint 960d38c3ce add some more tests for subcommand aliases 2023-10-08 20:14:34 -04:00
Alex Flint 0142b0b842 add subcommand aliases 2023-10-08 20:09:05 -04:00
Alex Flint 5ec29ce755
Merge pull request #229 from alexflint/dependabot/go_modules/gopkg.in/yaml.v3-3.0.0
Bump gopkg.in/yaml.v3 from 3.0.0-20200313102051-9f266ea9e77c to 3.0.0
2023-09-10 15:05:06 -07:00
dependabot[bot] 8e9f60aafc
Bump gopkg.in/yaml.v3 from 3.0.0-20200313102051-9f266ea9e77c to 3.0.0
Bumps gopkg.in/yaml.v3 from 3.0.0-20200313102051-9f266ea9e77c to 3.0.0.

---
updated-dependencies:
- dependency-name: gopkg.in/yaml.v3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-30 13:58:31 +00:00
Alex Flint 660b9045e1
Merge pull request #223 from hhromic/fix-version-flag
Improve handling of version flag
2023-07-14 15:52:33 -04:00
Hugo Hromic c73f38cd54
Improve handling of version flag
* 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-07-14 20:12:52 +01:00
Alex Flint 463902ef7d
Merge pull request #222 from IljaN/env-only-args
Support for parameters which can only be passed via env
2023-07-02 10:07:10 -04:00
Ilja Neumann 259c83fd5a Remove usage of additional envOnly struct variable 2023-06-29 21:26:34 +02:00
Ilja Neumann 18623d869b help,usage and error messages and tests 2023-06-03 12:47:47 +02:00
Ilja Neumann b928a1839a Parse env-only vars 2023-06-03 09:50:42 +02:00
Ilja Neumann ccf62e0ffc don't print env-vars in usage line 2023-06-03 03:33:10 +02:00
Pablo Diaz 5f10667949 fixed tests 2023-06-03 02:39:56 +02:00
Pablo Diaz c3cac76438 added tests and fixed usage 2023-06-03 02:39:56 +02:00
Pablo Diaz 0280e6e591 ignores short and long parameters 2023-06-03 02:39:42 +02:00
Alex Flint e25b4707a7
Merge pull request #211 from alexflint/clean-up-osexit-stderr-stdout
clean up customizable stdout, stderr, and exit in parser config
2023-02-08 06:56:56 -08:00
Alex Flint df28e7154b clean up customizable stdout, stderr, and exit in parser config 2023-02-08 09:49:03 -05:00
Alex Flint 5dbdd5d0c5
Merge pull request #210 from cabuda/master
feat: support more env than terminal
2023-02-08 06:13:50 -08:00
duxinlong efae1938fd feat: support more env than terminal
Change-Id: I7f35e90b8f19f4ea781832885d35e2f1e275207a
2023-02-08 12:01:48 +00:00
Alex Flint c0a8e20a0a
Merge pull request #205 from dmzkrsk/strict-subgroup-parsing
add strict subcommand parsing
2023-01-27 08:35:12 -08:00
Alexey Trofimov 5036dce2d6 fix typo 2023-01-18 11:52:13 +03:00
Alexey Trofimov cef66fd2f6 add strict subcommand parsing 2023-01-18 11:50:50 +03:00
Alex Flint 727f8533ac
Merge pull request #185 from alexflint/default-value-issue
Do not turn values intro strings and then back into values when processing default values
2022-10-29 12:29:07 -07:00
Alex Flint c046f49e12 drop go.work and add it to .gitignore 2022-10-29 15:28:22 -04:00
Alex Flint 3489ea5b2e in a second place: use reflect.Ptr not reflect.Pointer since the latter was added in Go 1.18 2022-10-29 15:23:56 -04:00
Alex Flint 763072452f use reflect.Ptr not reflect.Pointer since the latter was added in Go 1.18 2022-10-29 15:21:21 -04:00
Alex Flint 3d95a706a6 Merge remote-tracking branch 'origin/master' into default-value-issue 2022-10-29 15:19:23 -04:00
Alex Flint d949871b67 add further comment about backwards-compatible method for setting default values 2022-10-29 15:13:57 -04:00
Alex Flint 9d5e97ac8a drop unnecessary test 2022-10-29 15:12:53 -04:00
Alex Flint 67f7183b85 remove unused textMarshalerType and isTextMarshaler 2022-10-29 15:10:11 -04:00
Alex Flint 522dbbcea8 add test for the new default value parsing logic as it shows up in help messages 2022-10-29 15:08:48 -04:00
Alex Flint 27c832b934 store both a default value and a string representation of that default value in the spec for each option 2022-10-29 14:47:13 -04:00
Alex Flint f2539d7ad2 add go.work -- maybe remove before merge? 2022-10-29 12:28:46 -04:00
Alex Flint 197e226c77 drop unnecessary use of templates in this test 2022-10-29 12:28:06 -04:00
Alex Flint dbc2ba5d0c
Merge pull request #198 from daenney/mustparse
Implement MustParse on Parser
2022-10-10 08:41:57 -07:00
Daniele Sluijters 4fc9666f79 Implement MustParse on Parse
This moves most of the body of the MustParse function into a MustParse
method on a Parser. The MustParse function is now implemented by calling
the MustParse function on the Parser it implicitly creates.

Closes: #194
2022-10-10 17:25:14 +02:00
Alex Flint 2ffe24630b add mdtest command to generate and run tests from a markdown file 2022-10-07 14:14:01 -07:00
Alex Flint 47ff44303f drop support for help tag inside arg tag 2022-10-07 12:51:55 -07:00
Alex Flint 60a0117880 update readme for v2 (still has some TODOs) 2022-10-07 12:51:27 -07:00
Alex Flint 55d9025329 rename "accumulatedArgs" -> "accessible" 2022-10-04 13:54:53 -07:00
Alex Flint 0769dd5839 add tests for new Process* and OverwriteWith* functions 2022-10-04 13:51:51 -07:00
Alex Flint 84b7154efc add TestSliceWithEqualsSign 2022-10-04 13:25:01 -07:00
Alex Flint 1cc263f9f2 add processSequence and make it responsible for respecting "overwrite" 2022-10-04 13:23:57 -07:00
Alex Flint b365ec0781 add processSingle and make it responsible for checking whether an argument has been seen before 2022-10-04 13:12:38 -07:00
Alex Flint 64288c5521 add appendToSlice, appendToMap, appendToSliceOrMap 2022-10-04 12:48:04 -07:00
Alex Flint 2775f58376 add OverwriteWithOptions, OverwriteWithCommandLine 2022-10-04 12:34:53 -07:00
Alex Flint 5f0c48f092 move construction logic out of parse.go into construct.go 2022-10-04 11:54:22 -07:00
Alex Flint 5ca19cd72d cleaned up the test helpers parse, pparse, and parseWithEnv: now all are just using "parse" 2022-10-04 11:39:58 -07:00