So I'm trying to build a shell, and I've been stuck for days just trying to think about how to take in the input from the user. I need to be able to have a list of dynamically growing commands, that each has its list of dynamically growing arguments, so that I can handle situations where pipes occur, or regular commands occur with arguments, or redirections etc.
my first idea was make a struct of command types that held the char* command name, an array of arguments, and the size for the array of args. I could then make a vector of this. This idea seems pretty difficult to do though
The second idea was make a vector of vectors of char*s. so like
vector< <vector<char*> >, but this gives me errors like ISO C++ forbids items with no type. So i guess I cannot declare a vector of vectors? or am I declaring it wrong.
I want the easiest possible way to do this, because I am just stuck on it for three days straight now.
If someone could help me I would much appreciate it.