Skip to content

Commit ec60087

Browse files
committed
Changed commandline options to use groups instead of disableGroups
1 parent 3b0220c commit ec60087

File tree

5 files changed

+18
-9
lines changed

5 files changed

+18
-9
lines changed

ChromeDevExtWarningPatcher/CommandLineOptions.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
namespace ChromeDevExtWarningPatcher {
55
public class CommandLineOptions {
6-
[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 = ',')]
7-
public IEnumerable<int> DisabledGroups { get; set; }
6+
[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 = ',')]
7+
public IEnumerable<int> Groups { get; set; }
88

99
[Option('w', "noWait", Required = false, HelpText = "Disable the almost-pointless wait after finishing")]
1010
public bool NoWait { get; set; }

ChromeDevExtWarningPatcher/Program.cs

+12-3
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,14 @@ public static void Main(string[] args)
5050
bytePatchManager = new BytePatchManager(CustomConsoleWrite);
5151

5252
List<string> applicationPaths = new List<string>();
53-
54-
if(clOptions.CustomPath != null && clOptions.CustomPath.Length > 0) {
53+
List<int> groups = new List<int>(clOptions.Groups);
54+
55+
if(groups.Count == 0) {
56+
Console.WriteLine("Groups need to be defined. Use --help for help.");
57+
return;
58+
}
59+
60+
if (clOptions.CustomPath != null && clOptions.CustomPath.Length > 0) {
5561
if(!Directory.Exists(clOptions.CustomPath)) {
5662
Console.WriteLine("CustomPath not found");
5763
return;
@@ -62,7 +68,10 @@ public static void Main(string[] args)
6268
applicationPaths.AddRange(new InstallationFinder.InstallationManager().FindAllChromiumInstallations());
6369
}
6470

65-
bytePatchManager.DisabledGroups.AddRange(clOptions.DisabledGroups);
71+
foreach (GuiPatchGroupData patchData in bytePatchManager.PatchGroups) {
72+
if (!groups.Contains(patchData.Group))
73+
bytePatchManager.DisabledGroups.Add(patchData.Group);
74+
}
6675

6776
foreach (string path in applicationPaths) {
6877
try {

ChromeDevExtWarningPatcher/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
[assembly: Guid("0254db23-b64d-4d54-8ff8-f4d570e95ad4")]
1717

1818

19-
[assembly: AssemblyVersion("3.6.0.0")]
20-
[assembly: AssemblyFileVersion("3.6.0.0")]
19+
[assembly: AssemblyVersion("3.7.0.0")]
20+
[assembly: AssemblyFileVersion("3.7.0.0")]

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ All commandline options are **optional** and not required. If none are given, th
3434
3535
```
3636
ChromeDevExtWarningPatcher.exe
37-
--disableGroups Set what patch groups you don't want to use. See patterns.xml to get the group ids (comma-seperated: 0,1,2)
37+
--groups Set what patch groups you want to use. See patterns.xml to get the group ids (comma-seperated: 0,1,2)
3838

3939
-w, --noWait Disable the almost-pointless wait after finishing
4040

patterns.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
Create a new issue if a pattern stops working with any browser.
1212
-->
1313

14-
<Defaults version="3.6">
14+
<Defaults version="3.7">
1515
<Patterns>
1616
<Pattern name="Remove Extension Warning">
1717
<!-- ShouldIncludeExtension; "ProxyOverriddenBubble.UserSelection" 2nd function in the vtable -->

0 commit comments

Comments
 (0)