From 7a784f318ac2d310306eb1b9bc7bf38eb3243ce1 Mon Sep 17 00:00:00 2001 From: cairo Date: Wed, 4 Mar 2026 14:11:34 +1100 Subject: [PATCH] Started --- src/main.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/main.cpp diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..d0863da --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,39 @@ +#include +/* + * Make sure to do + * splain() { + * splain_ "$BASH_COMMAND" + * } + * in the bash during installation + */ +char** tokenisation(std::string arg) { + std::vector tokenList; + bool inQuotes = false; + unsigned char activeToken = 0; + for (int i = 0; i < arg.length(); i++) { + if (arg[i] == ' ') { + if (inQuotes) { + tokenList[activeToken] += ' '; + } else { + activeToken++; + tokenList.push_back(""); + } + } else if (arg[i] == '"') { + if (inQuotes) { + inQuotes = false; + } else { + inQuotes = true; + } + } else { + tokenList[activeToken] += arg[i]; + } + } +} +int main(int argc, char *argv[]) { + if (argc < 2) { + std::cerr << "Usage: splain [OPTIONS] " << std::endl; + return 1; + } + + return 0; +}