summaryrefslogtreecommitdiffstats
path: root/src/main/Plugins/TargetPlugins/Manual/ManualArgumentsProvider.cs
blob: 34a76e137e6aa3c7dfb21bb92c42faef97805a06 (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
using Fclp;
using PKISharp.WACS.Configuration;

namespace PKISharp.WACS.Plugins.TargetPlugins
{
    class ManualArgumentsProvider : BaseArgumentsProvider<ManualArguments>
    {
        public override string Name => "Manual plugin";
        public override string Group => "Target";
        public override string Condition => "--target manual";

        public override bool Active(ManualArguments current)
        {
            return !string.IsNullOrEmpty(current.Host);
        }

        public override void Configure(FluentCommandLineParser<ManualArguments> parser)
        {
            parser.Setup(o => o.CommonName)
                .As("commonname")
                .WithDescription("Specify the common name of the certificate. If not provided the first host name will be used.");
            parser.Setup(o => o.Host)
                .As("host")
                .WithDescription("A host name to get a certificate for. This may be a comma separated list.");
        }
    }
}