Skip to content

Commit

Permalink
Add deprecated parameter, for GitTools#428
Browse files Browse the repository at this point in the history
  • Loading branch information
serra committed Aug 19, 2015
1 parent 6e1db37 commit 0a3bc68
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/GitVersionExe.Tests/ArgumentParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,13 @@ public void assemblyversionformat_should_throw_warning(string args)
exception.Message.ShouldBe("assemblyversionformat switch removed, use AssemblyVersioningScheme configuration value instead");
}

[TestCase("-updateassemblyinfoname")]
public void updateassemblyinfoname_should_throw_warning(string args)
{
var exception = Should.Throw<WarningException>(() => ArgumentParser.ParseArguments(args));
exception.Message.ShouldBe("updateassemblyinfoname deprecated, use --updateassemblyinfo=[assemblyinfo.cs] instead");
}

[Test]
[TestCase("-showconfig")]
[TestCase("--showConfig+")]
Expand Down
9 changes: 7 additions & 2 deletions src/GitVersionExe/ArgumentParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ public static OptionSet GetOptionSet(Arguments arguments)
v => arguments.TargetBranch = v
},
{
"updateassemblyinfo:", "Will recursively search for all 'AssemblyInfo.cs' files in the git repo and update them",
"updateassemblyinfo:", "Will recursively search for all 'AssemblyInfo.cs' files in the git repo and update them/n" +
"Optionally specify the assembly info filename to update.",
v =>
{
if (v == null)
Expand All @@ -76,7 +77,11 @@ public static OptionSet GetOptionSet(Arguments arguments)
arguments.UpdateAssemblyInfoFileName = v;
}
}
}, // we should be able to use : as optional value here; then == null will indicate it was specified without value
},
{
"updateassemblyinfoname", "Deprecated: use --updateassemblyinfo [assemblyinfo.cs] instead.",
v => { throw new WarningException("updateassemblyinfoname deprecated, use --updateassemblyinfo=[assemblyinfo.cs] instead"); }
},
{
"dynamicrepolocation=", "By default dynamic repositories will be cloned to %tmp%. Use this switch to override",
v => arguments.DynamicRepositoryLocation = v
Expand Down

0 comments on commit 0a3bc68

Please sign in to comment.