Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/GitVersionCore/Extensions/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ public static bool ArgumentRequiresValue(this string argument, int argumentIndex
"init",
"updateassemblyinfo",
"ensureassemblyinfo",
"nofetch"
"nofetch",
"nonormalize",
"nocache",
};

var argumentMightRequireValue = !booleanArguments.Contains(argument.Substring(1), StringComparer.OrdinalIgnoreCase);
Expand Down
46 changes: 46 additions & 0 deletions src/GitVersionExe.Tests/ArgumentParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,22 @@ public void OtherArgumentsCanBeParsedBeforeNofetch()
arguments.NoFetch.ShouldBe(true);
}

[Test]
public void OtherArgumentsCanBeParsedBeforeNonormalize()
{
var arguments = argumentParser.ParseArguments("targetpath -nonormalize");
arguments.TargetPath.ShouldBe("targetpath");
arguments.NoNormalize.ShouldBe(true);
}

[Test]
public void OtherArgumentsCanBeParsedBeforeNocache()
{
var arguments = argumentParser.ParseArguments("targetpath -nocache");
arguments.TargetPath.ShouldBe("targetpath");
arguments.NoCache.ShouldBe(true);
}

[Test]
public void OtherArgumentsCanBeParsedAfterNofetch()
{
Expand All @@ -335,6 +351,36 @@ public void OtherArgumentsCanBeParsedAfterNofetch()
arguments.Proj.ShouldBe("foo.sln");
}

[Test]
public void OtherArgumentsCanBeParsedAfterNonormalize()
{
var arguments = argumentParser.ParseArguments("-nonormalize -proj foo.sln");
arguments.NoNormalize.ShouldBe(true);
arguments.Proj.ShouldBe("foo.sln");
}

[Test]
public void OtherArgumentsCanBeParsedAfterNocache()
{
var arguments = argumentParser.ParseArguments("-nocache -proj foo.sln");
arguments.NoCache.ShouldBe(true);
arguments.Proj.ShouldBe("foo.sln");
}

[TestCase("-nofetch -nonormalize -nocache")]
[TestCase("-nofetch -nocache -nonormalize")]
[TestCase("-nocache -nofetch -nonormalize")]
[TestCase("-nocache -nonormalize -nofetch")]
[TestCase("-nonormalize -nocache -nofetch")]
[TestCase("-nonormalize -nofetch -nocache")]
public void SeveralSwitchesCanBeParsed(string commandLineArgs)
{
var arguments = argumentParser.ParseArguments(commandLineArgs);
arguments.NoCache.ShouldBe(true);
arguments.NoNormalize.ShouldBe(true);
arguments.NoFetch.ShouldBe(true);
}

[Test]
public void LogPathCanContainForwardSlash()
{
Expand Down