commandr icon indicating copy to clipboard operation
commandr copied to clipboard

feature enhancement: typed arg?

Open mw66 opened this issue 4 years ago • 1 comments

Hi,

Right now the arg's type is either string, or string[], and user need to convert manually to other types, e.g.

    int depth = args.arg("depth").to!int;

is it possible to allow user specify the arg type directly, e.g.

          .add(new IntArgument("depth", "dir depth"))

and access it directly later as:

    int depth = args.arg("depth");  // directly get int value

Thanks.

mw66 avatar Nov 27 '21 00:11 mw66

BTW, I think we only need to support 3 basic types:

-- string // already there -- bool -- int

mw66 avatar Nov 27 '21 00:11 mw66