diff --git a/src/Nyanbyte.Cli/Cli.cs b/src/Nyanbyte.Cli/Cli.cs new file mode 100644 index 0000000..8b9638b --- /dev/null +++ b/src/Nyanbyte.Cli/Cli.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Nyanbyte.Cli; + +public class Cli +{ + public static T Parse() + { + throw new NotImplementedException(); + } +} diff --git a/src/Nyanbyte.Cli/CliParser.cs b/src/Nyanbyte.Cli/CliParser.cs new file mode 100644 index 0000000..7b56f20 --- /dev/null +++ b/src/Nyanbyte.Cli/CliParser.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Nyanbyte.Cli; + +public class CliParser +{ + const char C_ESCAPE = '\\', C_QUOTE = '\'', C_DQUOTE = '"', C_SEP = ' '; + public CliParser(string data) + { + _data = data; + } + + public string _data; + + public void Tokenize() + { + bool escaped = false, quotes = false, strict = false; + for (int idx = 0; idx < _data.Length; ++idx) + { + char c = _data[idx]; + + //Analyze character + } + + throw new NotImplementedException(); + } +}