cmdr_dev~dsl - Cmdr - Internals of DSL handling
Welcome to the Cmdr project, written by Andreas Kupries.
For availability please read Cmdr - How To Get The Sources.
This internal document provides an overview on how the framework implements the specification languages for officers, privates, and parameters.
For more information about other internals of the framework please read Cmdr - The Developer's Guide.
The officer DSL is implemented in cmdr::officer.
While the specification is supplied with the instance constructor it is not processed immediately, but saved for when it is actually needed.
The internal instance method Setup is called at all places requiring access to the specification and processes it (once, on first call) to provide the necessary in-memory structures.
The DSL commands map to instance methods as shown below:
Alias
cmdr::actor set
custom-setup
Default
cmdr::actor description:
See intercept. Deprecated.
intercept
Officer, forward to DefineAction
Private, forward to DefineAction
cmdr::actor undocumented
The private DSL is only partially implemented in cmdr::private. Most of the implementation is in cmdr::config.
While the specification is supplied with the instance constructor it is not processed immediately, but saved for when it is actually needed.
The internal instance method Setup is called at all places requiring access to the specification and processes it (once, on first call) to provide the necessary in-memory structures. This then delegates to the embedded config instance.
The DSL commands map to config instance methods as shown below:
Description, forward to cmdr::actor description:
Input, forward to DefineParameter)
Interactive
Option, forward to DefineParameter)
Section
State, forward to DefineParameter)
Undocumented, forward to cmdr::actor undocumented
Use
The parameter DSL is implemented in cmdr::parameter.
The specification is supplied with the instance constructor and processed immediately. This is different from officers and privates which defer processing until use. When a parameter is declared the containing private is in use, and so is the parameter. Thus no delay.
The DSL commands map to instance methods as shown below:
Alias
Default
Defered
Generate
Immediate
Interact
Label
List
NoPromote
Optional
Presence
Test
Undocumented
Validate
WhenComplete
WhenSet
Both the package(s) and this documentation will undoubtedly contain bugs and other problems. Please report such at Cmdr Tickets.
Please also report any ideas you may have for enhancements of either package(s) and/or documentation.
arguments, command hierarchy, command line completion, command line handling, command tree, editing command line, help for command line, hierarchy of commands, interactive command shell, optional arguments, options, parameters, processing command line, tree of commands
Copyright © 2013-2016 Andreas Kupries
Copyright © 2013-2016 Documentation, Andreas Kupries