Skip to content

Commit

Permalink
get-version -v should be case-insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
asherber committed Jul 24, 2019
1 parent 039d462 commit d12fda4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/nbgv/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace Nerdbank.GitVersioning.Tool
using System.CommandLine;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using Newtonsoft.Json;
Expand All @@ -25,6 +26,8 @@ internal class Program

private const string DefaultRef = "HEAD";

private const BindingFlags CaseInsensitiveFlags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.IgnoreCase;

private enum ExitCodes
{
OK,
Expand Down Expand Up @@ -316,7 +319,7 @@ private static ExitCodes OnGetVersionCommand(string projectPath, string format,
return ExitCodes.UnsupportedFormat;
}

var property = oracle.GetType().GetProperty(singleVariable);
var property = oracle.GetType().GetProperty(singleVariable, CaseInsensitiveFlags);
if (property == null)
{
Console.Error.WriteLine("Variable \"{0}\" not a version property.", singleVariable);
Expand Down

0 comments on commit d12fda4

Please sign in to comment.