aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Program.cs
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-11-16 14:35:19 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-11-16 14:35:19 +0200
commit0ee81ef847af3702b3b37f94cc62e835f9294e55 (patch)
treee3cc6daea355c8cc7a5dbf48f5e0c594230d90fb /Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Program.cs
parent76b22e4d05cbd8d771f678e4b5adc2dc5159afa8 (diff)
downloadTango-0ee81ef847af3702b3b37f94cc62e835f9294e55.tar.gz
Tango-0ee81ef847af3702b3b37f94cc62e835f9294e55.zip
Working on DataStore WebAPI & CLI.
Diffstat (limited to 'Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Program.cs')
-rw-r--r--Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Program.cs49
1 files changed, 49 insertions, 0 deletions
diff --git a/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Program.cs b/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Program.cs
new file mode 100644
index 000000000..e27f76c79
--- /dev/null
+++ b/Software/Visual_Studio/DataStore/Tango.DataStore.CLI/Program.cs
@@ -0,0 +1,49 @@
+using CommandLine;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.BL;
+
+namespace Tango.DataStore.CLI
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ var result = Parser.Default.ParseArguments<GetOptions, PutOptions>(args)
+ .WithParsed<GetOptions>((options) =>
+ {
+ Console.WriteLine($"{options.Email}, {options.Password}");
+ })
+ .WithParsed<PutOptions>((options) =>
+ {
+ Console.WriteLine($"{options.Email}, {options.Password}");
+ })
+ .WithNotParsed((errors) =>
+ {
+
+ });
+
+ Console.ReadLine();
+ }
+
+ private static int DisplayHelp<T>(ParserResult<T> result, IEnumerable<Error> errs)
+ {
+ var helpText = CommandLine.Text.HelpText.AutoBuild(result, h =>
+ {
+ h.AdditionalNewLineAfterOption = false;
+ h.AddNewLineBetweenHelpSections = true;
+ h.AddEnumValuesToHelpText = true;
+ h.AutoVersion = false;
+ h.Heading = CommandLine.Text.HeadingInfo.Empty;
+ h.MaximumDisplayWidth = 110;
+ // h.AddVerbs(typeof(SyncOptions), typeof(QueryOptions), typeof(TokenOptions));
+ return h; // only h
+ });
+ Console.WriteLine(helpText);
+ return 1;
+ }
+ }
+}