Skip to content

Commit

Permalink
发布0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gqqnbig committed Aug 9, 2018
2 parents abeb6ec + d8cfa96 commit a3accf3
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@
<h1> <img src="https://github.com/gqqnbig/uMatrixCleaner/raw/master/uMatrixCleaner/icon_128.png" width="32" /> μMatrix规则清理器 </h1>

## 命令行参数
用中括号包起来的元素为可选项。如`--MergeThreshold [x]`表示可以输入`--MergeThreshold 4``--MergeThreshold`

### --Help
显示帮助

### -Log
保存XML日志。如果本选项后带有参数"d",则日志保存在[当前目录](https://docs.microsoft.com/zh-cn/dotnet/api/system.appcontext.basedirectory?view=netframework-4.7.2),文件名是uMatrix-_日期_.xml。如果参数是其他值,则该值指定日志的完整路径。
### --Help
显示帮助

### --MergeThreshold
合并类似规则的阀值。默认值为3。
### -Log
保存XML日志。如果本选项后带有参数"d",则日志保存在[当前目录](https://docs.microsoft.com/zh-cn/dotnet/api/system.appcontext.basedirectory?view=netframework-4.7.2),文件名是uMatrix-_日期_.xml。如果参数是其他值,则该值指定日志的完整路径。

### --MergeThreshold [x]
x为整数,默认值为3。

设置合并类似规则的阀值。

当阀值为3时,

Expand All @@ -36,8 +40,10 @@


### --RandomDelete x
随机删除百分之x的规则。x的默认值为5。
### --RandomDelete [x]
x为整数,默认值为5。

设置随机删除百分之x的规则。

### --Verbose
在命令行中输出详细信息
Expand All @@ -46,5 +52,5 @@
输入文件路径 [输出文件路径]
#### 输入文件路径
保存μMatrix规则的文件的路径
#### 输出文件路径
#### [输出文件路径]
可选。清理后的规则文件的路径。如果不指定,则保存在*输入文件路径*的同级目录,文件名是uMatrix-*日期*.txt。
2 changes: 1 addition & 1 deletion Tests/Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
9 changes: 8 additions & 1 deletion uMatrixCleaner/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ where line.StartsWith("matrix-off") || line.StartsWith("noscript-spoof") || line
SaveEvents(events);
var newWorkingRules = newRules;

return string.Join(Environment.NewLine, ignoredLines)+ Environment.NewLine + string.Join(Environment.NewLine, isFixedRules[true].Union(newWorkingRules));
return string.Join(Environment.NewLine, ignoredLines) + Environment.NewLine + string.Join(Environment.NewLine, isFixedRules[true].Union(newWorkingRules));

}

Expand Down Expand Up @@ -222,6 +222,7 @@ private static List<UMatrixRule> ReadHistorialDeletions()
}
}

logger.LogInformation("载入{0}条历史被删记录。", deletedRules.Count);
return deletedRules;
}

Expand Down Expand Up @@ -271,6 +272,12 @@ private static bool ParseOptions(string[] args)
return true;
}

if (argList.Count == 0)
{
logger.LogError("至少存在1个位置参数,而实际发现0个。");
return true;
}

if (argList.Count > 2)
{
logger.LogError("最多支持2个位置参数,而实际发现{0}个:{1}", argList.Count, string.Join(" ", argList));
Expand Down
2 changes: 1 addition & 1 deletion uMatrixCleaner/uMatrixCleaner.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
<Authors>gqqnbig</Authors>
</PropertyGroup>

Expand Down

0 comments on commit a3accf3

Please sign in to comment.