forked from siteserver/cms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOptions.cs
More file actions
77 lines (64 loc) · 2.24 KB
/
Options.cs
File metadata and controls
77 lines (64 loc) · 2.24 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
using System;
using System.Collections.Generic;
using System.Text;
using BaiRong.Core;
using CommandLine;
using CommandLine.Text;
namespace siteserver
{
internal class BuildSubOptions
{
[Option('a', "all", HelpText = "Tell the command to automatically stage files.")]
public bool All { get; set; }
}
internal class RunSubOptions
{
// Remainder omitted
}
internal class TestSubOptions
{
[Option('a', "all", HelpText = "Tell the command to automatically stage files.")]
public bool All { get; set; }
}
internal class EncodeSubOptions
{
[Option('s', "string", Required = true, HelpText = "Input string to be processed.")]
public string String { get; set; }
}
internal class DecodeSubOptions
{
[Option('s', "string", Required = true, HelpText = "Input string to be processed.")]
public string String { get; set; }
}
internal class Options
{
[Option]
public bool Verbose { get; set; } // --verbose
[Option('q')]
public bool Quiet { get; set; } // -q
[HelpOption]
public string GetUsage()
{
var help = new HelpText
{
Heading = new HeadingInfo("SiteServer 命令行", "V" + AppManager.Version),
Copyright = new CopyrightInfo("北京百容千域软件技术开发有限责任公司", DateTime.Now.Year),
AdditionalNewLineAfterOption = true,
AddDashesToOption = true
};
help.AddPreOptionsLine("用法: siteserver <command> <options>");
help.AddOptions(this);
return help;
}
[VerbOption("build", HelpText = "生成站点")]
public BuildSubOptions BuildVerb { get; set; }
[VerbOption("run", HelpText = "运行任务")]
public RunSubOptions WatchVerb { get; set; }
[VerbOption("test", HelpText = "测试")]
public TestSubOptions TestVerb { get; set; }
[VerbOption("encode", HelpText = "加密字符串")]
public EncodeSubOptions EncodeVerb { get; set; }
[VerbOption("decode", HelpText = "解密字符串")]
public DecodeSubOptions DecodeVerb { get; set; }
}
}