Skip to content

Commit

Permalink
Allow passing a single file to ListBinaryInfo.
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillOsenkov committed Apr 11, 2017
1 parent f393cfb commit 42f94b9
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions ListBinaryInfo/ListBinaryInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,19 @@ static void Main(string[] args)
}
}

var root = Environment.CurrentDirectory;
var patterns = patternList.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
List<string> files = new List<string>();
foreach (var pattern in patterns)
var files = new List<string>();
if (File.Exists(patternList))
{
files.AddRange(Directory.GetFiles(root, pattern, SearchOption.AllDirectories));
files.Add(Path.GetFullPath(patternList));
}
else
{
var root = Environment.CurrentDirectory;
var patterns = patternList.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
foreach (var pattern in patterns)
{
files.AddRange(Directory.GetFiles(root, pattern, SearchOption.AllDirectories));
}
}

foreach (var file in files)
Expand Down

0 comments on commit 42f94b9

Please sign in to comment.