To help you get up to speed on how WetPancakeCLI works, please consider the following image:
The way it works is:
- The console receives input from the end-user;
- It then parses the input and matches it with a "command-method". (The command-methods live in "ConsoleCommands.cs".); After that,
- The command-method then runs and returns its result.
That's the simple version at least.
The reason the program runs this way is because I built it with Console.Waterworks (C.W.). If you would like to know about C.W., I recommend you use the following links:
- Console.Waterworks Repository
- Console.Waterworks Wiki
- Console.Waterworks.Core Repository (This is the .Net Core version.)
- Console.Waterworks.Core Wiki (The .Net Core version operates the same way as the traditional .Net one. So, this wiki is not as comprehensive and mostly serves as a place to set-up the .Net Core version of C.W.)
Because this wiki is not about learning the intricacies of how C.W. works, I will provide a basic overview of what it is. If you find yourself still needing more information, please use the links above. They go into a lot more detail and you can also inspect C.W's code if you want. If you want to work with the source code in this project, you do need a basic understanding of how C.W. works. Without it, you will find it difficult and some design decisions might seem odd. At a basic level,C.W. is a NuGet package which helps you write console programs. From a distance, C.W. programs look a bit like an M.V.C. program. To help explain, here is an illustration of C.W's basic structure/flow:
For C.W. to operate the way it does,it needs to rely on certain things, which are:
- C.W. controls the "input-loop" from main.
- There
ConsoleCommands
class must live in a name-space within the project. - The "command-methods" within
ConsoleCommands
are marked aspublic
andstatic
.
If you are new to the project, I recommend you take a moment looking at the code in "Program.cs"; Do this alongside looking at the code in "ConsoleCommands.cs". Once you have a good grasp of what is happening in "Program.cs", you should not need to look at it again. That is when you can start to focus on the code in "ConsoleCommands.cs" -- the place you where most of the work is.