Lean  $LEAN_TAG$
DownloaderDataProviderArgumentParser.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  *
8  * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15 */
16 
18 using McMaster.Extensions.CommandLineUtils;
20 
22 
24 {
25  private const string ApplicationName = "QuantConnect.DownloaderDataProvider.exe";
26  private const string ApplicationDescription = "Welcome to Lean Downloader Data Provider! 🚀 Easily download historical data from various sources with our user-friendly application. Start exploring financial data effortlessly!";
27  private const string ApplicationHelpText = "Hm...";
28 
29  private static readonly List<CommandLineOption> Options = new List<CommandLineOption>
30  {
31  new CommandLineOption(DownloaderCommandArguments.CommandDownloaderDataDownloader, CommandOptionType.SingleValue),
32  new CommandLineOption(DownloaderCommandArguments.CommandDataType, CommandOptionType.SingleValue),
33  new CommandLineOption(DownloaderCommandArguments.CommandTickers, CommandOptionType.MultipleValue),
34  new CommandLineOption(DownloaderCommandArguments.CommandSecurityType, CommandOptionType.SingleValue),
35  new CommandLineOption(DownloaderCommandArguments.CommandMarketName, CommandOptionType.SingleValue),
36  new CommandLineOption(DownloaderCommandArguments.CommandResolution, CommandOptionType.SingleValue),
37  new CommandLineOption(DownloaderCommandArguments.CommandStartDate, CommandOptionType.SingleValue),
38  new CommandLineOption(DownloaderCommandArguments.CommandEndDate, CommandOptionType.SingleValue)
39  };
40 
41  /// <summary>
42  /// Parses the command-line arguments and returns a dictionary containing parsed values.
43  /// </summary>
44  /// <param name="args">An array of command-line arguments.</param>
45  /// <returns>A dictionary containing parsed values from the command-line arguments.</returns>
46  /// <remarks>
47  /// The <paramref name="args"/> parameter should contain the command-line arguments to be parsed.
48  /// The method uses the ApplicationParser class to parse the arguments based on the ApplicationName,
49  /// ApplicationDescription, ApplicationHelpText, and Options properties.
50  /// </remarks>
51  public static Dictionary<string, object> ParseArguments(string[] args)
52  {
53  return ApplicationParser.Parse(ApplicationName, ApplicationDescription, ApplicationHelpText, args, Options);
54  }
55 }