go-arg icon indicating copy to clipboard operation
go-arg copied to clipboard

Add arguments group

Open SebastiaanPasterkamp opened this issue 2 years ago • 5 comments

Argument groups allow for nesting structs of logically related arguments. Although similar to sub commands an argument group does not require a trigger keyword (the command) and is compatible with both nested structs as well as struct pointers.

Resolves #179 with test coverage proving environment-only arguments are populated properly, and help messages now properly displays the help line for the (environment only) argument.

SebastiaanPasterkamp avatar Sep 26 '22 18:09 SebastiaanPasterkamp

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.02 :tada:

Comparison is base (e25b470) 99.72% compared to head (36d760a) 99.74%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #192      +/-   ##
==========================================
+ Coverage   99.72%   99.74%   +0.02%     
==========================================
  Files           5        5              
  Lines         716      775      +59     
==========================================
+ Hits          714      773      +59     
  Misses          1        1              
  Partials        1        1              
Impacted Files Coverage Δ
parse.go 99.55% <100.00%> (+0.04%) :arrow_up:
usage.go 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov-commenter avatar Sep 28 '22 18:09 codecov-commenter

Hey @alexflint, I know time is short :-) but this is really a nice feature I love to see in go-arg. If I can help in any case to speed this up just ping me.

kaedwen avatar Nov 25 '22 13:11 kaedwen

@alexflint There were too many confusing merge conflicts with my old version, so I've restarted the PR from just after v1.4.3. The changes and commits have also be consolidated to be more concise, so hopefully the changes are easier to review as well.

SebastiaanPasterkamp avatar Dec 10 '22 14:12 SebastiaanPasterkamp

This is a very nice feature! Thanks for opening this PR for it. Another similar feature is to implement argument groups with mutually exclusive arguments. I think once this PR here is merged, I can give it a try to implement the above idea on top of the work from this PR.

hhromic avatar Jul 06 '23 22:07 hhromic

@alexflint Are you still interested in this PR?

SebastiaanPasterkamp avatar Jul 07 '23 14:07 SebastiaanPasterkamp

Sorry it's been so long without response on this PR! After considering this I think this PR adds too much complexity to the code, relative to the feature it adds.

alexflint avatar Jul 04 '24 16:07 alexflint