Exemplo n.º 1
0
        private void LoadAssemblyUsage(ApplicationDocumentation applicationDocumentation, AssemblyDefinition assembly)
        {
            var assemblyUsageAttribute = assembly.GetAttributeOrDefault(CommandLineParserTypeNames.AssemblyUsageAttributeFullName);

            if (assemblyUsageAttribute != null)
            {
                applicationDocumentation.Usage = assemblyUsageAttribute.ConstructorArguments.Select(x => x.Value).Cast <string>().ToArray();
            }
        }
Exemplo n.º 2
0
        private IParameterCollection GetParameterCollection(ApplicationDocumentation application, ApplicationType applicationType)
        {
            switch (applicationType)
            {
            case ApplicationType.SingleCommand:
                return(Assert.IsType <SingleCommandApplicationDocumentation>(application));

            case ApplicationType.MultiCommand:
                var mutliCommandApplication = Assert.IsType <MultiCommandApplicationDocumentation>(application);
                return(Assert.Single(mutliCommandApplication.Commands));

            default:
                throw new NotImplementedException();
            }
        }
Exemplo n.º 3
0
 public ApplicationVersionBlock(ApplicationDocumentation model)
 {
     m_Model = model ?? throw new ArgumentNullException(nameof(model));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of <see cref="ParameterDocumentation"/>
 /// </summary>
 protected ParameterDocumentation(ApplicationDocumentation application, CommandDocumentation?command)
 {
     Application = application ?? throw new System.ArgumentNullException(nameof(application));
     Command     = command;
 }
Exemplo n.º 5
0
 public string GetPath(ApplicationDocumentation model) => "index.md";