Add flag for SafeGetFiles

This commit is contained in:
Matt Nadareski
2024-12-19 00:02:53 -05:00
parent 73d7c5790e
commit 35b1bb817e
4 changed files with 28 additions and 6 deletions

View File

@@ -29,11 +29,17 @@ namespace ProtectionScan
/// Scan file contents during protection scanning
/// </summary>
public bool ScanContents { get; private set; } = true;
/// <summary>
/// Scan file paths during protection scanning
/// </summary>
public bool ScanPaths { get; private set; } = true;
/// <summary>
/// Scan subdirectories during protection scanning
/// </summary>
public bool ScanSubdirectories { get; set; } = true;
#endregion
/// <summary>
@@ -74,11 +80,16 @@ namespace ProtectionScan
options.ScanContents = false;
break;
case "-ns":
case "-np":
case "--no-paths":
options.ScanPaths = false;
break;
case "-ns":
case "--no-subdirs":
options.ScanSubdirectories = false;
break;
default:
options.InputPaths.Add(arg);
break;
@@ -109,7 +120,8 @@ namespace ProtectionScan
Console.WriteLine("-d, --debug Enable debug mode");
Console.WriteLine("-nc, --no-contents Disable scanning for content checks");
Console.WriteLine("-na, --no-archives Disable scanning archives");
Console.WriteLine("-ns, --no-paths Disable scanning for path checks");
Console.WriteLine("-np, --no-paths Disable scanning for path checks");
Console.WriteLine("-ns, --no-subdirs Disable scanning subdirectories");
}
}
}

View File

@@ -35,6 +35,7 @@ namespace ProtectionScan
options.ScanArchives,
options.ScanContents,
options.ScanPaths,
options.ScanSubdirectories,
options.Debug,
fileProgress);