veged/coa

req() option doesn't affect help sheet

Closed this issue · 0 comments

Consider such code:

require('coa').Cmd()
    .name('myscript')
    .helpful()
    .opt()
        .name('target')
        .title('Target')
        .short('t').long('target')
        .req()
        .end()
    .opt()
        .name('path')
        .title('Path')
        .short('p').long('path')
        .def('~/bin')
        .end()
    .run()

When I add the "req()" method to an option, I expect to get a kind of hint on the help sheet, that the option is required. However, I get the same descriptions for different kinds of options.

£ ./myscript -h

Usage:
myscript [OPTIONS] [ARGS]

Options:
-h, --help : Help
-t TARGET, --target=TARGET : Target
-p PATH, --path=PATH : Path