Skip to content

How should users call your program

JFBlouin edited this page Apr 10, 2019 · 3 revisions

When the code is executed by the user, the first argument is the command name, followed by the arguments. The library will find the command and execute it passing in the parameters recieved. Otherwise, it will print help information.


Assuming the code compiles to MyApp.exe, a sample command would be

MyApp.exe SayHello --name UserName
or
MyApp.exe SayHello -n UserName

Command name can be ommited if (a) there is a single command or (b) there is a default command


General idea of logic

  1. The list of commands and parameters are parsed from the code.
  2. The command to run is extracted.
  3. The other arguments are extracted.
  4. Command method is invoked.

Clone this wiki locally