master
Craig Oates 4 years ago
parent
commit
e10c388e23
  1. 62
      Creating-the-Input-Loop.md

62
Creating-the-Input-Loop.md

@ -1,31 +1,31 @@
Because of how Console.Waterworks (C.W.) is set-up, the command the end-user enters into the prompt must match the name of the command-method -- in "ConsoleCommands.fs". I will elaborate on that in a moment but we must first look at how the program creates the input-loop. This will help explain why the end-user's commands must match with the command-methods.
```f#
open Console.Waterworks
[<EntryPoint>]
let main argv =
let liaison = new CW_Liaison ()
liaison.Run ("Commands", true)
0 // return an integer exit code
```
That snippet of code is all what is in "Program.fs". Once you know what is happening in here, you should never need to look at this file much -- if at all.
What is happening is a new `CW_Liaison` object is created and is told to `run`. This is where C.W. creates the input-loop which runs indefinitely until the end-user closes the console (or the program crashes). The first argument passed into `run` refers to the name-space of the `ConsoleCommands` module. In this case, it is `Commands`. The second one refers to the information displayed in the console when you run it. When set to `true`, the console displays information found in "AssemblyInfo.fs". If you use `false`, the only thing you will see is the prompt. You can check the code and the name-space of the `ConsoleCommands` module via the following link:
- ["Commands.fs"](https://git.abbether.net/craig.oates/Death-Socket/blob/master/DeathSocketCLI/Commands.fs)
How C.W. creates and manages the input-loop is out of this wiki's scope. Although, you can use learn about how it via the following link:
- [Console.Waterworks Wiki](https://git.abbether.net/craig.oates/Console.Waterworks/wikis/The-Flow-of-the-System)
Here are examples of what is displayed at run-time when you pass `true` or `false` into the `liaison.Run` command, mentioned above.
![deathsocket cli assembly info](deathsocketcli-assembly-info.png)
![deathsocket cli assembly info](deathsocketcli-no-assembly-info.png)
Up above, I said I would elaborate on why the end-user's commands must match the name of the commands in the `ConsoleCommands` module. I will do that but not here because it ventures a little too far off topic for this section. So, I have created a dedicated section for it. You can access it with the following link:
- [Command-Methods Overview](Command-Methods-Overview)
Because of how Console.Waterworks (C.W.) is set-up, the command the end-user enters into the prompt must match the name of the command-method -- in "ConsoleCommands.fs". I will elaborate on that in a moment but we must first look at how the program creates the input-loop. This will help explain why the end-user's commands must match with the command-methods.
```f#
open Console.Waterworks
[<EntryPoint>]
let main argv =
let liaison = new CW_Liaison ()
liaison.Run ("Commands", true)
0 // return an integer exit code
```
That snippet of code is all what is in "Program.fs". Once you know what is happening in here, you should never need to look at this file much -- if at all.
What is happening is a new `CW_Liaison` object is created and is told to `run`. This is where C.W. creates the input-loop which runs indefinitely until the end-user closes the console (or the program crashes). The first argument passed into `run` refers to the name-space of the `ConsoleCommands` module. In this case, it is `Commands`. The second one refers to the information displayed in the console when you run it. When set to `true`, the console displays information found in "AssemblyInfo.fs". If you use `false`, the only thing you will see is the prompt. You can check the code and the name-space of the `ConsoleCommands` module via the following link:
- [Commands.fs](https://git.abbether.net/craig.oates/Death-Socket/src/branch/master/DeathSocketCLI/Commands.fs)
How C.W. creates and manages the input-loop is out of this wiki's scope. Although, you can use learn about how it via the following link:
- [Console.Waterworks Wiki](https://git.abbether.net/craig.oates/Console.Waterworks/wiki/The-Flow-of-the-System)
Here are examples of what is displayed at run-time when you pass `true` or `false` into the `liaison.Run` command, mentioned above.
![deathsocket cli assembly info](deathsocketcli-assembly-info.png)
![deathsocket cli assembly info](deathsocketcli-no-assembly-info.png)
Up above, I said I would elaborate on why the end-user's commands must match the name of the commands in the `ConsoleCommands` module. I will do that but not here because it ventures a little too far off topic for this section. So, I have created a dedicated section for it. You can access it with the following link:
- [Command-Methods Overview](Command-Methods-Overview)

Loading…
Cancel
Save