Skip to content

Make it possible to create options sections #450

@NicolasMassart

Description

@NicolasMassart

Hi,
I was wondering if there's plans to enable options sections in help output like we can see in https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options

WHISPER (EXPERIMENTAL) OPTIONS:
  --shh                       Enable Whisper
  --shh.maxmessagesize value  Max message size accepted (default: 1048576)
  --shh.pow value             Minimum POW accepted (default: 0.2)
  
DEPRECATED OPTIONS:
  --fast   Enable fast syncing through state downloads (replaced by --syncmode)
  --light  Enable light client mode (replaced by --syncmode)
  
MISC OPTIONS:
  --help, -h  show help

By having something like an attribute in the @Option indicating a section id and map of sections id and sections titles in the @Command. Then we would be able to group options (@Command.groupOptions boolean attribute ?) by section.
Sorting (@Command.sortOptions attribute) could also affect the order of appearance of that in the way that alphabetical would also sort section first and options in the section.
Also a being able to use @| in sections title would be nice if we could also add an uppercase style :

@Command(sections = {
    new Section("sec0","@|uppercase My first section|@",
    new Section("sec1","@|uppercase My second section|@",
    new Section("sec2","@|uppercase My third section|@"
}

then
@Option(section = "sec0" ... )

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions