-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImportOptions.cs
43 lines (36 loc) · 1.25 KB
/
ImportOptions.cs
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
42
43
using System.IO;
using CommandLine;
using CommandLine.Text;
namespace MediaImport
{
public class ImportOptions
{
public DirectoryInfo SourceFolder { get; set; }
public DirectoryInfo TargetFolder { get; set; }
[ValueOption(0)]
public string SourceFolderName
{
get { return SourceFolder.FullName; }
set { SourceFolder = new DirectoryInfo(value); }
}
[ValueOption(1)]
public string TargetFolderName
{
get { return TargetFolder.FullName; }
set { TargetFolder = new DirectoryInfo(value); }
}
[Option('e', "ext", HelpText = "File Extension", DefaultValue = "jpg")]
public string Extension { get; set; }
[Option('d', "dry-run", HelpText = "Do not actually move files")]
public bool DryRun { get; set; }
[Option('c', "copy", HelpText = "Copy files instead of moving them")]
public bool Copy { get; set; }
[HelpOption]
public string GetUsage()
{
return "Usage: MediaImport source target" +
HelpText.AutoBuild(this,
current => HelpText.DefaultParsingErrorsHandler(this, current));
}
}
}