Skip to content

Commit d12fda4

Browse files
committed
get-version -v should be case-insensitive
1 parent 039d462 commit d12fda4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/nbgv/Program.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ namespace Nerdbank.GitVersioning.Tool
55
using System.CommandLine;
66
using System.IO;
77
using System.Linq;
8+
using System.Reflection;
89
using System.Threading;
910
using System.Threading.Tasks;
1011
using Newtonsoft.Json;
@@ -25,6 +26,8 @@ internal class Program
2526

2627
private const string DefaultRef = "HEAD";
2728

29+
private const BindingFlags CaseInsensitiveFlags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.IgnoreCase;
30+
2831
private enum ExitCodes
2932
{
3033
OK,
@@ -316,7 +319,7 @@ private static ExitCodes OnGetVersionCommand(string projectPath, string format,
316319
return ExitCodes.UnsupportedFormat;
317320
}
318321

319-
var property = oracle.GetType().GetProperty(singleVariable);
322+
var property = oracle.GetType().GetProperty(singleVariable, CaseInsensitiveFlags);
320323
if (property == null)
321324
{
322325
Console.Error.WriteLine("Variable \"{0}\" not a version property.", singleVariable);

0 commit comments

Comments
 (0)