Commits

Matt Hamilton  committed bf909b4

Made ShortName case insensitive

  • Participants
  • Parent commits d92b6fa

Comments (0)

Files changed (4)

File Example/Program.cs

         [Description("Any integer value")]
         public int Level { get; set; }
 
-        [Display(ShortName = "msg", Description = "The message to be displayed")]
+        [Display(ShortName = "Msg", Description = "The message to be displayed")]
         public string Message { get; set; }
 
         [Description("The person you should not shoot")]

File MadProps.AppArgs.1.0.nupkg

Binary file removed.

File MadProps.AppArgs/AppArgs.cs

                    select new ArgProperty
                    {
                        Property = p,
-                       Name = alias == null || String.IsNullOrWhiteSpace(alias.ShortName) ? p.Name.ToLower() : alias.ShortName,
+                       Name = alias == null || String.IsNullOrWhiteSpace(alias.GetShortName()) ? p.Name.ToLower() : alias.GetShortName(),
                        Type = p.PropertyType,
                        Required = p.Attribute<RequiredAttribute>(),
                        RequiresValue = !(p.PropertyType == typeof(bool) || p.PropertyType == typeof(bool?)),
                        Description = d != null && !String.IsNullOrWhiteSpace(d.Description) ? d.Description
-                          : alias != null ? alias.Description : String.Empty
+                          : alias != null ? alias.GetDescription() : String.Empty
                    };
         }
 
 
             foreach (var arg in arguments)
             {
-                var matches = props.Where(p => p.Name.StartsWith(arg.Key)).ToList();
+                var matches = props.Where(p => p.Name.StartsWith(arg.Key, StringComparison.OrdinalIgnoreCase)).ToList();
                 if (matches.Count == 0)
                 {
                     throw new ArgumentException("Unknown argument '" + arg.Key + "'");

File NuGet/MadProps.AppArgs.nuspec

 <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
   <metadata>
     <id>MadProps.AppArgs</id>
-    <version>1.0</version>
+    <version>1.0.1</version>
     <authors>Matt Hamilton</authors>
     <owners>Matt Hamilton</owners>
     <projectUrl>https://bitbucket.org/mabster/madprops.appargs</projectUrl>