[ Home | Main Table Of Contents | Table Of Contents | Keyword Index ]

cmdr_dev~dsl(n) 1.0 doc "Cmdr, a framework for command line parsing and dispatch"

Name

cmdr_dev~dsl - Cmdr - Internals of DSL handling

Table Of Contents

Synopsis

  • package require cmdr

Description

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.

Officer DSL

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

Alias

common

cmdr::actor set

default

Default

description

cmdr::actor description:

ehandler

ehandler

officer

Officer, forward to DefineAction

private

Private, forward to DefineAction

undocumented

cmdr::actor undocumented

Private DSL

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

Description, forward to cmdr::actor description:

input

Input, forward to DefineParameter)

interactive

Interactive

option

Option, forward to DefineParameter)

section

Section

state

State, forward to DefineParameter)

undocumented

Undocumented, forward to cmdr::actor undocumented

use

Use

Parameter DSL

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

Alias

default

Default

defered

Defered

generate

Generate

immediate

Immediate

interact

Interact

label

Label

list

List

no-promotion

NoPromote

optional

Optional

presence

Presence

test

Test

undocumented

Undocumented

validate

Validate

when-complete

WhenComplete

when-set

WhenSet

Bugs, Ideas, Feedback

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.

Keywords

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