diff --git a/source/Prebuild/Core/Utilities/CommandLineCollection.cs b/source/Prebuild/Core/Utilities/CommandLineCollection.cs index 4485197..8bf9d63 100644 --- a/source/Prebuild/Core/Utilities/CommandLineCollection.cs +++ b/source/Prebuild/Core/Utilities/CommandLineCollection.cs @@ -41,9 +41,10 @@ public class CommandLineCollection : IEnumerable> /// /// Create a new CommandLine instance and set some internal variables. /// - public CommandLineCollection(string[] args) + public CommandLineCollection(string[] args, bool useTackInsteadOfSlash=false) { m_RawArgs = args; + ArgSymbol = useTackInsteadOfSlash ? '-' : '/'; Parse(); } @@ -84,7 +85,7 @@ public class CommandLineCollection : IEnumerable> { var arg = m_RawArgs[idx]; - if (arg.Length > 2 && arg[0] == '/') + if (arg.Length > 2 && arg[0] == ArgSymbol) { arg = arg.Substring(1); lastArg = arg; @@ -124,6 +125,11 @@ public class CommandLineCollection : IEnumerable> // The raw OS arguments private readonly string[] m_RawArgs; + /// + /// Argument symbol for parsing + /// + private readonly char ArgSymbol; + // Command-line argument storage private readonly Dictionary m_Arguments = new();