Handle fully-qualified enum names used as Config branch values

This commit is contained in:
Zahary Karadjov 2020-06-23 17:11:22 +03:00
parent aac25d1610
commit bea0769db0
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
1 changed files with 3 additions and 1 deletions

View File

@ -701,7 +701,9 @@ proc cmdInfoFromType(T: NimNode): CmdInfo =
error "Sub-command parameters cannot appear in an else branch. " &
"Please specify the sub-command branch precisely", field.caseBranch[0]
let branchEnumVal = field.caseBranch[0]
var branchEnumVal = field.caseBranch[0]
if branchEnumVal.kind == nnkDotExpr:
branchEnumVal = branchEnumVal[1]
var cmd = findCmd(discriminator.subCmds, $branchEnumVal)
cmd.opts.add opt