From e49ab2de01f4e610d7035d07facd967cf3acc7af Mon Sep 17 00:00:00 2001 From: ricardofslp Date: Wed, 3 May 2023 23:50:33 +0100 Subject: [PATCH] feat: add blame option --- src/RerunCommand/RerunCommandConfiguration.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/RerunCommand/RerunCommandConfiguration.cs b/src/RerunCommand/RerunCommandConfiguration.cs index c6a5e8e..cae2fb9 100644 --- a/src/RerunCommand/RerunCommandConfiguration.cs +++ b/src/RerunCommand/RerunCommandConfiguration.cs @@ -18,6 +18,7 @@ public class RerunCommandConfiguration public bool NoBuild { get; private set; } public bool NoRestore { get; private set; } public int Delay { get; private set; } + public bool Blame { get; private set; } #endregion Properties @@ -94,6 +95,14 @@ public class RerunCommandConfiguration IsRequired = false, }; + private readonly Option BlameOption = + new(new[] { "--blame" }) + { + Description = "Runs the tests in blame mode.", + IsRequired = false, + Arity = ArgumentArity.Zero + }; + #endregion Options public void Set(Command cmd) @@ -108,6 +117,7 @@ public void Set(Command cmd) cmd.Add(NoBuildOption); cmd.Add(NoRestoreOption); cmd.Add(DelayOption); + cmd.Add(BlameOption); } public void GetValues(InvocationContext context) @@ -122,6 +132,7 @@ public void GetValues(InvocationContext context) NoBuild = context.ParseResult.FindResultFor(NoBuildOption) is not null; NoRestore = context.ParseResult.FindResultFor(NoRestoreOption) is not null; Delay = context.ParseResult.GetValueForOption(DelayOption) * 1000; + Blame = context.ParseResult.FindResultFor(BlameOption) is not null; } public string GetArgumentList() @@ -131,7 +142,8 @@ public string GetArgumentList() AddArguments(Settings, SettingsOption), AddArguments(TrxLogger, LoggerOption), AddArguments(NoBuild, NoBuildOption), - AddArguments(NoRestore, NoRestoreOption)); + AddArguments(NoRestore, NoRestoreOption), + AddArguments(Blame, BlameOption)); public string AddArguments(T value, Option option) => value is not null