From 0a3bc683ff0f8ad71ad370a76c370f1f90e8f52b Mon Sep 17 00:00:00 2001 From: Marijn van der Zee Date: Wed, 19 Aug 2015 14:51:52 +0200 Subject: [PATCH] Add deprecated parameter, for #428 --- src/GitVersionExe.Tests/ArgumentParserTests.cs | 7 +++++++ src/GitVersionExe/ArgumentParser.cs | 9 +++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/GitVersionExe.Tests/ArgumentParserTests.cs b/src/GitVersionExe.Tests/ArgumentParserTests.cs index 1e89ddacc6..292e6a41a2 100644 --- a/src/GitVersionExe.Tests/ArgumentParserTests.cs +++ b/src/GitVersionExe.Tests/ArgumentParserTests.cs @@ -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(() => ArgumentParser.ParseArguments(args)); + exception.Message.ShouldBe("updateassemblyinfoname deprecated, use --updateassemblyinfo=[assemblyinfo.cs] instead"); + } + [Test] [TestCase("-showconfig")] [TestCase("--showConfig+")] diff --git a/src/GitVersionExe/ArgumentParser.cs b/src/GitVersionExe/ArgumentParser.cs index 4f31c34c0a..dd80d5e127 100644 --- a/src/GitVersionExe/ArgumentParser.cs +++ b/src/GitVersionExe/ArgumentParser.cs @@ -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) @@ -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