| | 1 | | namespace Songhay.Models; |
| | 2 | |
|
| | 3 | | /// <summary> |
| | 4 | | /// Defines conventional command-line arguments. |
| | 5 | | /// </summary> |
| | 6 | | public class ProgramArgs |
| | 7 | | { |
| | 8 | | /// <summary> |
| | 9 | | /// Initializes a new instance of the <see cref="ProgramArgs"/> class. |
| | 10 | | /// </summary> |
| | 11 | | /// <param name="args">The arguments.</param> |
| 16 | 12 | | public ProgramArgs(string?[] args) |
| 16 | 13 | | { |
| 16 | 14 | | Args = args.OfType<string>().ToArray(); |
| 29 | 15 | | if (Args.Any()) HelpSet = new Dictionary<string, string>(capacity: Args.Length); |
| 16 | 16 | | } |
| | 17 | |
|
| | 18 | | /// <summary> |
| | 19 | | /// The base-path argument. |
| | 20 | | /// </summary> |
| | 21 | | public const string BasePath = "--base-path"; |
| | 22 | |
|
| | 23 | | /// <summary> |
| | 24 | | /// The base path required argument. |
| | 25 | | /// </summary> |
| | 26 | | public const string BasePathRequired = "--base-path-required"; |
| | 27 | |
|
| | 28 | | /// <summary> |
| | 29 | | /// The help argument. |
| | 30 | | /// </summary> |
| | 31 | | public const string Help = "--help"; |
| | 32 | |
|
| | 33 | | /// <summary> |
| | 34 | | /// The input file argument. |
| | 35 | | /// </summary> |
| | 36 | | public const string InputFile = "--input-file"; |
| | 37 | |
|
| | 38 | | /// <summary> |
| | 39 | | /// The input <see cref="string" /> argument. |
| | 40 | | /// </summary> |
| | 41 | | public const string InputString = "--input-string"; |
| | 42 | |
|
| | 43 | | /// <summary> |
| | 44 | | /// The output file argument. |
| | 45 | | /// </summary> |
| | 46 | | public const string OutputFile = "--output-file"; |
| | 47 | |
|
| | 48 | | /// <summary> |
| | 49 | | /// Use the output file argument relative to <see cref="ProgramArgs.BasePath"/>. |
| | 50 | | /// </summary> |
| | 51 | | public const string OutputUnderBasePath = "--output-under-base-path"; |
| | 52 | |
|
| | 53 | | /// <summary> |
| | 54 | | /// The settings file argument. |
| | 55 | | /// </summary> |
| | 56 | | public const string SettingsFile = "--settings-file"; |
| | 57 | |
|
| | 58 | | /// <summary> |
| | 59 | | /// Gets the arguments. |
| | 60 | | /// </summary> |
| 142 | 61 | | public string[] Args { get; } |
| | 62 | |
|
| | 63 | | /// <summary> |
| | 64 | | /// Gets the help set. |
| | 65 | | /// </summary> |
| 40 | 66 | | public Dictionary<string, string> HelpSet { get; } = new(); |
| | 67 | | } |