Lean  $LEAN_TAG$
ReportArgumentParser.cs
1 /*
2  * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
3  * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14 */
15 
16 using System.Collections.Generic;
17 using McMaster.Extensions.CommandLineUtils;
18 
20 {
21  /// <summary>
22  /// Command Line arguments parser for Report Creator
23  /// </summary>
24  public static class ReportArgumentParser
25  {
26  private const string ApplicationName = "Report Creator";
27 
28  private const string ApplicationDescription =
29  "LEAN Report Creator generates beautiful PDF reports from your backtesting strategies for sharing with prospective partners.";
30 
31  private const string ApplicationHelpText =
32  "If you are looking for help, please go to https://www.quantconnect.com/docs";
33 
34  private static readonly List<CommandLineOption> Options = new List<CommandLineOption>
35  {
36  new CommandLineOption("close-automatically", CommandOptionType.SingleValue),
37  new CommandLineOption("data-folder", CommandOptionType.SingleValue),
38  new CommandLineOption("strategy-name", CommandOptionType.SingleValue, "Strategy name"),
39  new CommandLineOption("strategy-description", CommandOptionType.SingleValue, "Strategy description"),
40  new CommandLineOption("live-data-source-file", CommandOptionType.SingleValue, "Live source data json file"),
41  new CommandLineOption("backtest-data-source-file", CommandOptionType.SingleValue, "Backtest source data json file"),
42  new CommandLineOption("report-destination", CommandOptionType.SingleValue, "Destination of processed report file"),
43  new CommandLineOption("report-css-override-file", CommandOptionType.SingleValue, "CSS override source file"),
44  new CommandLineOption("report-html-custom-file", CommandOptionType.SingleValue, "Custom HTML source file"),
45  };
46 
47  /// <summary>
48  /// Parse and construct the args.
49  /// </summary>
50  public static Dictionary<string, object> ParseArguments(string[] args)
51  {
52  return ApplicationParser.Parse(ApplicationName, ApplicationDescription, ApplicationHelpText, args, Options);
53  }
54  }
55 }