docopt / docopt.net

Port of docopt to .net

Home Page:https://docopt.github.io/docopt.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Duplicate property names generated into T4DocoptNet.cs

geoff5777 opened this issue · comments

Consider this doc excerpt:

Usage:
   Send.exe (table|view) TABLE [-a alias] -s <instance> -d <database> 
                                        [-m <queueManagerName>] -q <queueName> [-p
   Send.exe message MESSAGE [-m <queueManagerName>] -q <queueName

The resulting generated code duplicates OptQueuemanager and OptQueue properties.
This was resolved by adding Distinct() in the final loop of Docopt.GenerateCode():

    foreach (var p in res.Flat().Distinct())
    {
        sb.AppendLine(p.GenerateCode());
    }
    return sb.ToString();

👍 I'm getting this issue as well