8.18
top
← prev up next →

Extensible Command LineπŸ”— i

This library defines a more extensible version of command-line that supports command line flag expanders, allowing users to abstract over common command line flag patterns. This library also comes batteries-included with many pre-defined expanders for commmon patterns such as switches that toggle boolean parameters.

Source code is available at https://github.com/jackfirth/command-line-ext

1Core FormsπŸ”— i

syntax

( command-line-ext maybe-nameflag-clause...final-clause)

Like command-line, but with a few important differences. In addition to the normal options for flag-clause that command-line allows, a flag clause may also be of the form (begin-flagsflag-clause...), which has exactly the same semantics as if each flag-clause contained within begin-flags was spliced into the surrounding list of flag clauses. Additionally, command-line-ext supports command line flag expanders, which are similar to match expanders and allow a user to extend the grammar of flag-clause. A custom flag-clause created with define-command-line-flag-expander can expand to multiple flag clauses by using begin-flags.

syntax

( define-command-line-flag-expander idtransformer-expr)

Binds id as a command line flag expander. When (idexpr...) appears as a flag-clause in command-line-ext , a syntax object representing (idexpr...) is passed to transformer-expr, which must be an expression that evaluates to a procedure of one argument at phase 1. Whatever syntax object transformer-expr returns is then used in place of (idexpr...) as a flag-spec.

top
← prev up next →

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /