summaryrefslogtreecommitdiffstats
path: root/src/main.lib/Plugins/TargetPlugins/IIS/IISArgumentsProvider.cs
blob: 24787239c1b07839af0eca48b1d52b2b480c6aa9 (plain)
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
using Fclp;
using PKISharp.WACS.Configuration;

namespace PKISharp.WACS.Plugins.TargetPlugins
{
    internal class IISArgumentsProvider : BaseArgumentsProvider<IISArguments>
    {
        public override string Name => "IIS plugin";
        public override string Group => "Target";
        public override string Condition => "--target iis";

        public const string PatternExamples = "You may use a `*` for a range of any characters and a `?` " +
                "for any single character. For example: the pattern `example.*` will match `example.net` and " +
                "`example.com` (but not `my.example.com`) and the pattern `?.example.com` will match " +
                "`a.example.com` and `b.example.com` (but not `www.example.com`). Note that multiple patterns " +
                "can be combined by comma seperating them.";

        public override void Configure(FluentCommandLineParser<IISArguments> parser)
        {
            parser.Setup(o => o.SiteId)
                .As("siteid")
                .WithDescription("Identifiers of one or more sites to include. " +
                "This may be a comma seperated list.");
            parser.Setup(o => o.Host)
                .As("host")
                .WithDescription("Host name to filter. This parameter may be used to target specific bindings. " +
                "This may be a comma seperated list.");
            parser.Setup(o => o.Pattern)
                .As("host-pattern")
                .WithDescription("Pattern filter for host names. Can be used to dynamically include bindings " +
                "based on their match with the pattern. " + PatternExamples);
            parser.Setup(o => o.Regex)
                .As("host-regex")
                .WithDescription("Regex pattern filter for host names. Some people, when confronted with a " +
                "problem, think \"I know, I'll use regular expressions.\" Now they have two problems.");
            parser.Setup(o => o.CommonName)
                .As("commonname")
                .WithDescription("Specify the common name of the certificate that should be requested for the target. By default this will be the first binding that is enumerated.");
            parser.Setup(o => o.ExcludeBindings)
                .As("excludebindings")
                .WithDescription("Exclude host names from the certificate. This may be a comma separated list.");
        }
    }
}