Skip to content

Commit e5d6236

Browse files
author
Roelant Vos
committed
Refactor + basic support voor 'all metadata' templates.
1 parent 517a949 commit e5d6236

4 files changed

Lines changed: 264 additions & 108 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace RunDwhAutomation
8+
{
9+
/// <summary>
10+
/// Helper class to simplify providing unit-testing parameters/arguments.
11+
/// </summary>
12+
internal class CommandLineArgumentHelper
13+
{
14+
internal string[] args;
15+
16+
public CommandLineArgumentHelper()
17+
{
18+
this.args = Environment.GetCommandLineArgs();
19+
}
20+
21+
public CommandLineArgumentHelper(string[] testArgs)
22+
{
23+
this.args = testArgs;
24+
}
25+
}
26+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
using CommandLine;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
8+
namespace RunDwhAutomation
9+
{
10+
/// <summary>
11+
/// Command line options (arguments, parameters).
12+
/// </summary>
13+
internal class Options
14+
{ // Inputs
15+
[Option('i', "input", Required = true, Separator = ';', HelpText = "The filename or directories (separated by semicolons) of the (input) Json file(s) containing the automation metadata.")]
16+
public IEnumerable<string> input { get; set; }
17+
18+
[Option('p', "pattern", Required = true, HelpText = "The filename for the (input) Handlebars pattern.")]
19+
public string pattern { get; set; }
20+
21+
// Outputs
22+
[Option('o', "output", Required = false, HelpText = "Enable output to be spooled to disk (enable/disable) - default is disable.")]
23+
public bool output { get; set; }
24+
25+
[Option('d', "outputdirectory", Required = false, HelpText = "The directory where spool files (output) are placed. If not provided, the execution directory will be assumed.")]
26+
public string outputDirectory { get; set; }
27+
28+
[Option('e', "outputextension", Required = false, HelpText = "The extension used for the output file(s). This is defaulted to txt when left empty.")]
29+
public string outputFileExtension { get; set; }
30+
31+
[Option('f', "outputfilename", Required = false, HelpText = "The name of the output file(s). This is defaulted to the mapping name in the metadata object when left empty.")]
32+
public string outputFileName { get; set; }
33+
34+
// Other
35+
[Option('v', "verbose", Required = false, HelpText = "Set output to verbose messages.")]
36+
public bool verbose { get; set; }
37+
38+
[Option('r', "recursive", Required = false, HelpText = "Enable recursive search through subdirectories when input is a directory.")]
39+
public bool recursive { get; set; }
40+
41+
[Option('c', "combine", Required = false, HelpText = "Combine all metadata files into a single object and process with template once.")]
42+
public bool combine { get; set; }
43+
}
44+
}

0 commit comments

Comments
 (0)