Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sub-groups #28

Closed
rvesse opened this issue Aug 6, 2015 · 4 comments
Closed

Support sub-groups #28

rvesse opened this issue Aug 6, 2015 · 4 comments
Assignees
Labels
enhancement Proposed Enhancement/Feature
Milestone

Comments

@rvesse
Copy link
Owner

rvesse commented Aug 6, 2015

Changes necessary:

  • Make sure whitespace is forbidden in group names
  • Add .getSubGroups() to GroupMetadata and modify constructor signature as needed
  • Add .withSubGroup() to GroupBuilder
  • Support using whitespace in group names in @Group and @Groups annotations to create sub-groups e.g. foo bar would create a group bar that is a sub-group of the group foo OR would place a command into that group
  • Update parser to be able to support sub-groups
  • Update help generators to cope with sub-groups (this is probably the biggest piece of work)
@rvesse rvesse added the enhancement Proposed Enhancement/Feature label Aug 6, 2015
@rvesse rvesse added this to the 2.0.0 milestone Aug 6, 2015
@rvesse rvesse self-assigned this Aug 6, 2015
rvesse added a commit that referenced this issue Aug 6, 2015
- CommandGroupMetadata has additional fields as necessary
- GroupBuilder supports specifying sub-groups
- MetadataLoader copes with sub-groups appropriately
rvesse added a commit that referenced this issue Aug 6, 2015
The parser is now capable of supporting sub-groups
rvesse added a commit that referenced this issue Aug 6, 2015
Adds a very basic unit test to verify sub-groups functionality and
makes some bug fixes to CliBuilder and CommandGroupMetadata that were
necessary to get the test passing
rvesse added a commit that referenced this issue Aug 6, 2015
- Fix a bug introduced by prior commits related to ensuring default
  command is added to commands list explicitly
- Improve logic in `Help.help()` so that it takes into account
  sub-groups when deciding what help to show
@rvesse
Copy link
Owner Author

rvesse commented Aug 12, 2015

The bulk of this is implemented and working, the major open issues are as follows:

  • Sub-groups do not currently inherit group options from parent groups
  • Help generators have no knowledge of sub-groups yet

Also test coverage needs to be added for the following:

  • Accessing help for a sub-group

rvesse added a commit that referenced this issue Aug 12, 2015
Expands the unit test coverage for the various ways of annotating groups
so that they cover the ability to generate sub-groups.

Also fixes a couple of potential bugs:

- Commands annotated into a sub-group were not removed from the top
  level default group
- Group hierarchy might be built in a non-optimal order
@rvesse
Copy link
Owner Author

rvesse commented Aug 13, 2015

Realised that group options do not need to be inherited since they actually get extracted from the commands placed into the group rather than flowing down the hierarchy

rvesse added a commit that referenced this issue Aug 13, 2015
Test how group options can be added to multiple groups in the hierarchy
rvesse added a commit that referenced this issue Aug 13, 2015
Adapt the existing help generator interfaces to account for the ability
to have sub-groups
rvesse added a commit that referenced this issue Aug 13, 2015
- Fix a bug in how Help command determines what help to display
- Start adding unit tests for help some of which are failing currently
rvesse added a commit that referenced this issue Aug 13, 2015
- Fix additional bug in deciding what kind of help to show
- Improve help displayed by CliCommandGroupUsageGenerator so sub-groups
  and their sub-groups and commands are listed
@rvesse
Copy link
Owner Author

rvesse commented Aug 13, 2015

Help changes are now mostly done

@rvesse
Copy link
Owner Author

rvesse commented Oct 2, 2015

Completed as far as I am aware

@rvesse rvesse closed this as completed Oct 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Proposed Enhancement/Feature
Projects
None yet
Development

No branches or pull requests

1 participant