-
Notifications
You must be signed in to change notification settings - Fork 3
/
Options.cs
executable file
·48 lines (36 loc) · 1.17 KB
/
Options.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
44
45
46
47
48
using System;
using PowerArgs;
namespace consolestatisticsappcsharp
{
public class Options
{
[ArgRequired(PromptIfMissing = true)]
public string ApiKey { get; set; }
[ArgRequired(PromptIfMissing = true)]
public string Username { get; set; }
[ArgRequired(PromptIfMissing = true)]
public string Password { get; set; }
[ArgRequired(PromptIfMissing = true)]
public string BaseUrl { get; set; }
[ArgRequired(PromptIfMissing = true)]
public string ClientId { get; set; }
[ArgRequired(PromptIfMissing = true)]
public string ClientSecret { get; set; }
public string AuthBaseUrl { get; set; }
public bool AutoLogin { get; set; }
public static Options parseOptions(string[] args)
{
Options options = null;
try
{
options = Args.Parse<Options>(args);
}
catch (ArgException ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine(ArgUsage.GenerateUsageFromTemplate<Options>());
}
return options;
}
}
}