From ec600877680adad6554ba615cd63a8870da66524 Mon Sep 17 00:00:00 2001 From: Ceiridge Date: Fri, 1 May 2020 00:18:09 +0200 Subject: [PATCH] Changed commandline options to use groups instead of disableGroups --- ChromeDevExtWarningPatcher/CommandLineOptions.cs | 4 ++-- ChromeDevExtWarningPatcher/Program.cs | 15 ++++++++++++--- .../Properties/AssemblyInfo.cs | 4 ++-- README.md | 2 +- patterns.xml | 2 +- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/ChromeDevExtWarningPatcher/CommandLineOptions.cs b/ChromeDevExtWarningPatcher/CommandLineOptions.cs index 8ad25ac..eceaa08 100644 --- a/ChromeDevExtWarningPatcher/CommandLineOptions.cs +++ b/ChromeDevExtWarningPatcher/CommandLineOptions.cs @@ -3,8 +3,8 @@ namespace ChromeDevExtWarningPatcher { public class CommandLineOptions { - [Option("disableGroups", Required = false, HelpText = "Set what patch groups you don't want to use. See patterns.xml to get the group ids (comma-seperated: 0,1,2)", Separator = ',')] - public IEnumerable DisabledGroups { get; set; } + [Option("groups", Required = false, HelpText = "Set what patch groups you want to use. See patterns.xml to get the group ids (comma-seperated: 0,1,2)", Separator = ',')] + public IEnumerable Groups { get; set; } [Option('w', "noWait", Required = false, HelpText = "Disable the almost-pointless wait after finishing")] public bool NoWait { get; set; } diff --git a/ChromeDevExtWarningPatcher/Program.cs b/ChromeDevExtWarningPatcher/Program.cs index ebeccaa..acb8665 100644 --- a/ChromeDevExtWarningPatcher/Program.cs +++ b/ChromeDevExtWarningPatcher/Program.cs @@ -50,8 +50,14 @@ public static void Main(string[] args) bytePatchManager = new BytePatchManager(CustomConsoleWrite); List applicationPaths = new List(); - - if(clOptions.CustomPath != null && clOptions.CustomPath.Length > 0) { + List groups = new List(clOptions.Groups); + + if(groups.Count == 0) { + Console.WriteLine("Groups need to be defined. Use --help for help."); + return; + } + + if (clOptions.CustomPath != null && clOptions.CustomPath.Length > 0) { if(!Directory.Exists(clOptions.CustomPath)) { Console.WriteLine("CustomPath not found"); return; @@ -62,7 +68,10 @@ public static void Main(string[] args) applicationPaths.AddRange(new InstallationFinder.InstallationManager().FindAllChromiumInstallations()); } - bytePatchManager.DisabledGroups.AddRange(clOptions.DisabledGroups); + foreach (GuiPatchGroupData patchData in bytePatchManager.PatchGroups) { + if (!groups.Contains(patchData.Group)) + bytePatchManager.DisabledGroups.Add(patchData.Group); + } foreach (string path in applicationPaths) { try { diff --git a/ChromeDevExtWarningPatcher/Properties/AssemblyInfo.cs b/ChromeDevExtWarningPatcher/Properties/AssemblyInfo.cs index 9592d9e..1026903 100644 --- a/ChromeDevExtWarningPatcher/Properties/AssemblyInfo.cs +++ b/ChromeDevExtWarningPatcher/Properties/AssemblyInfo.cs @@ -16,5 +16,5 @@ [assembly: Guid("0254db23-b64d-4d54-8ff8-f4d570e95ad4")] -[assembly: AssemblyVersion("3.6.0.0")] -[assembly: AssemblyFileVersion("3.6.0.0")] +[assembly: AssemblyVersion("3.7.0.0")] +[assembly: AssemblyFileVersion("3.7.0.0")] diff --git a/README.md b/README.md index 3594df6..58caccc 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ All commandline options are **optional** and not required. If none are given, th ``` ChromeDevExtWarningPatcher.exe - --disableGroups Set what patch groups you don't want to use. See patterns.xml to get the group ids (comma-seperated: 0,1,2) + --groups Set what patch groups you want to use. See patterns.xml to get the group ids (comma-seperated: 0,1,2) -w, --noWait Disable the almost-pointless wait after finishing diff --git a/patterns.xml b/patterns.xml index b46ab87..8fb6a3f 100644 --- a/patterns.xml +++ b/patterns.xml @@ -11,7 +11,7 @@ Create a new issue if a pattern stops working with any browser. --> - +