Working 'argument' pragma

This commit is contained in:
Zahary Karadjov 2019-10-28 21:16:01 +02:00
parent 0129a56b78
commit 533a621d4a
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
1 changed files with 4 additions and 1 deletions

View File

@ -605,8 +605,11 @@ macro buildCommandTree(RecordType: type): untyped =
shortform = field.readPragma"shortform"
longform = field.readPragma"longform"
desc = field.readPragma"desc"
optKind = if field.isDiscriminator: Discriminator
elif field.readPragma("argument") != nil: Arg
else: CliSwitch
var opt = OptInfo(kind: if field.isDiscriminator: Discriminator else: CliSwitch,
var opt = OptInfo(kind: optKind,
idx: fieldIdx,
longform: $field.name,
hasDefault: defaultValue != nil,