This commit is contained in:
meelstorm
2025-10-15 13:13:47 +02:00
parent 97ac18eac6
commit dec036dbcf
16 changed files with 534 additions and 678 deletions

View File

@@ -0,0 +1,35 @@
namespace VisionBuilder.UI.Common;
public class CommandLineParser
{
private readonly List<string> _args;
public CommandLineParser(string[] args)
{
_args = args.ToList();
}
public string? GetStringArgument(string key, char shortKey)
{
var index = _args.IndexOf("--" + key);
if (index >= 0 && _args.Count > index)
{
return _args[index + 1];
}
index = _args.IndexOf("-" + shortKey);
if (index >= 0 && _args.Count > index)
{
return _args[index + 1];
}
return null;
}
public bool GetSwitchArgument(bool value, char shortKey)
{
return _args.Contains("--" + value) || _args.Contains("-" + shortKey);
}
}