-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
41 lines (34 loc) · 1.02 KB
/
Copy pathProgram.cs
File metadata and controls
41 lines (34 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using Sortify.Enums;
using Sortify.Services;
namespace Sortify;
class Program()
{
static void Main(string[] args)
{
if (args.Length == 0 || args.Length > 2)
{
Console.WriteLine("Usage: sortify <folder-path> [--sort-by-type | --sort-by-category]");
return;
}
var sortMethod = SortMethod.None;
string folderPath = args[0];
bool sortByType = args.Contains("--sort-by-type");
bool sortByCategory = args.Contains("--sort-by-category");
if (sortByType)
{
sortMethod = SortMethod.SortByType;
}
else if (sortByCategory)
{
sortMethod = SortMethod.SortByCategory;
}
if (!Directory.Exists(folderPath))
{
Console.WriteLine("Folder path not found");
return;
}
Console.WriteLine($"Folder path: {folderPath}");
Console.WriteLine($"Sort by: {sortMethod}");
FileSorterService.SortFiles(folderPath, sortMethod);
}
}