airline
airline copied to clipboard
Support grouping options by category in help generators
Requires adding a new category property to the @Option
annotation (or a separate @OptionCategory
) annotation to state category information
Help generators would then use this additional optional information to group options together in their outputs
Suggested plan:
- Add
category
field to@Option
annotation - Add class level
@OptionCategory
annotation (and@OptionCategories
) which has the following signature:
@OptionCategory(title = "Title", description = "Describes the category", id = "id")
Whereid
is the value that should be placed in thecategory
field of@Option
- Discover and store
@OptionCategory
meta-data inCommandMetadata
(and maybeGroupMetadata
/GlobalMetadata
as well?) - Provide a
Comparator<OptionMetadata>
that does a category based sort of options - Update help generator implementations to understand how to print options with their associated category descriptors