Skip to content

KumarL/Ek

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EK - command line params generator

Ek generates C++ code from the usage string of a console application. The generated code makes all the input parameters available to the application as static members of the generated class.

Usage String Syntax

The format of the usage string that Ek accepts is influenced by the PowerShell help content. Following are the command line params:

Flags

The flags are specified as [-FlagName] in the usage string.

Parameters

A parameter can be specified in any of the following ways:

  1. [-ParamName <param value help text>]

    The presence of square brackets makes a parameter property optional. Here, ParamName is an optional parameter and the generated code would not terminate with error if the user does not provide ParamName value at the time of invoking the associate console application.

  2. [-ParamName] <param value help text>

    ParamName is optional here, but the parameter value is not. Therefore, the command line can pass this value without specifying -ParamName.

  3. [[-ParamName] <param value help text>]

    This parameter is optional, and if specified, does not need -ParamName always. In this case, both the parameter and the name specifier are optional.

  4. -ParamName <param value help text>

    There are no optional parts to this parameter. This parameter value should be specified by the user always, and with the -ParamName specifier.

Examples

  1. shutdown [-m] [-k] [-comp] <computer name> -timer <number in seconds>

    This shows a usage string with four parameters. Two are flags, -m, and -k. Two others are parameters. Please note that value of timer always needs to be specified by -Timer, but passing a string would be assumed to be computer name without always requiring its specifier -comp.

  2. ek [-str] <usage string> [-outnamespace <name space>] -out <filename without extension>

    This is the usage string of Ek. Every parameter is required here, except outnamespace. We use the generated code in the Ek project itself.

About

Tool to generate command line parser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages