Skip to content

Commit

Permalink
Changed commandline options to use groups instead of disableGroups
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceiridge committed Apr 30, 2020
1 parent 3b0220c commit ec60087
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
4 changes: 2 additions & 2 deletions ChromeDevExtWarningPatcher/CommandLineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<int> 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<int> Groups { get; set; }

[Option('w', "noWait", Required = false, HelpText = "Disable the almost-pointless wait after finishing")]
public bool NoWait { get; set; }
Expand Down
15 changes: 12 additions & 3 deletions ChromeDevExtWarningPatcher/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,14 @@ public static void Main(string[] args)
bytePatchManager = new BytePatchManager(CustomConsoleWrite);

List<string> applicationPaths = new List<string>();

if(clOptions.CustomPath != null && clOptions.CustomPath.Length > 0) {
List<int> groups = new List<int>(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;
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions ChromeDevExtWarningPatcher/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion patterns.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Create a new issue if a pattern stops working with any browser.
-->

<Defaults version="3.6">
<Defaults version="3.7">
<Patterns>
<Pattern name="Remove Extension Warning">
<!-- ShouldIncludeExtension; "ProxyOverriddenBubble.UserSelection" 2nd function in the vtable -->
Expand Down

0 comments on commit ec60087

Please sign in to comment.