summaryrefslogtreecommitdiff
path: root/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/Util/CommandLineParser.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/Util/CommandLineParser.cs')
-rw-r--r--Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/Util/CommandLineParser.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/Util/CommandLineParser.cs b/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/Util/CommandLineParser.cs
new file mode 100644
index 0000000..4d4d3c9
--- /dev/null
+++ b/Library/PackageCache/com.unity.ide.rider@1.1.4/Rider/Editor/Util/CommandLineParser.cs
@@ -0,0 +1,36 @@
+using System.Collections.Generic;
+
+namespace Packages.Rider.Editor.Util
+{
+ public class CommandLineParser
+ {
+ public Dictionary<string, string> Options = new Dictionary<string, string>();
+
+ public CommandLineParser(string[] args)
+ {
+ var i = 0;
+ while (i < args.Length)
+ {
+ var arg = args[i];
+ if (!arg.StartsWith("-"))
+ {
+ i++;
+ continue;
+ }
+
+ string value = null;
+ if (i + 1 < args.Length && !args[i + 1].StartsWith("-"))
+ {
+ value = args[i + 1];
+ i++;
+ }
+
+ if (!(Options.ContainsKey(arg)))
+ {
+ Options.Add(arg, value);
+ }
+ i++;
+ }
+ }
+ }
+} \ No newline at end of file