mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Fix wildcard regression
This commit is contained in:
@@ -515,14 +515,6 @@ namespace SabreTools.Library.Help
|
|||||||
if (!valid && !exact)
|
if (!valid && !exact)
|
||||||
valid = this.Features.Keys.Any(k => this.Features[k].ValidateInput(input));
|
valid = this.Features.Keys.Any(k => this.Features[k].ValidateInput(input));
|
||||||
|
|
||||||
// If we're not valid at this point, we want to check if this flag is a file or a folder
|
|
||||||
if (!valid)
|
|
||||||
valid = File.Exists(input) || Directory.Exists(input);
|
|
||||||
|
|
||||||
// If we're not valid at this point, we weant to check if the flag is a wildcarded input
|
|
||||||
if (!valid)
|
|
||||||
valid = input.Contains("*") || input.Contains("?");
|
|
||||||
|
|
||||||
return valid;
|
return valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,19 +23,27 @@ namespace SabreTools.Library.Help
|
|||||||
// Verify that the current flag is proper for the feature
|
// Verify that the current flag is proper for the feature
|
||||||
if (!ValidateInput(args[i]))
|
if (!ValidateInput(args[i]))
|
||||||
{
|
{
|
||||||
Globals.Logger.Error($"Invalid input detected: {args[i]}");
|
// Special precautions for files and directories
|
||||||
help.OutputIndividualFeature(this.Name);
|
if (File.Exists(args[i]) || Directory.Exists(args[i]))
|
||||||
Globals.Logger.Close();
|
{
|
||||||
return false;
|
Inputs.Add(args[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Special precautions for wildcarded inputs (potential paths)
|
||||||
|
else if (args[i].Contains("*") || args[i].Contains("?"))
|
||||||
|
{
|
||||||
|
Inputs.Add(args[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Everything else isn't a file
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Globals.Logger.Error($"Invalid input detected: {args[i]}");
|
||||||
|
help.OutputIndividualFeature(this.Name);
|
||||||
|
Globals.Logger.Close();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Special precautions for files and directories
|
|
||||||
if (File.Exists(args[i]) || Directory.Exists(args[i]))
|
|
||||||
Inputs.Add(args[i]);
|
|
||||||
|
|
||||||
// Special precautions for wildcarded inputs (potential paths)
|
|
||||||
if (args[i].Contains("*") || args[i].Contains("?"))
|
|
||||||
Inputs.Add(args[i]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user