select
Modify the selection set in a batch script or interactive terminal. The selection set determines the set of items within the active vault that commands execute on.
usage: cmri select [--add] [--remove] <selection-expressions>
required arguments:
|
A list of |
options:
|
Append the provided expressions to the current selection set. |
|
Invert the provided selection expressions so the elements they match are removed from the selection set. |
Please note that both --add
and --remove
may not be specified at the same time.
Specification
CodeMRI processes selection sets delimited by the :
or ;
character, containing glob expressions that match one or more elements within a given vault. Selections are hierarchical– in order to select a system, it’s containing project must be selected. The Vault is always selected and may never be deselected as only a single vault may be used in a given session.
CodeMRI accepts selections through the following mechanisms, in order of precedence from lowest to highest:
-
The CMRI_SELECTION environment variable.
-
The –selection command-line argument.
-
The select command in an interactive terminal.
Selection Expressions
A selection expression is a wildcard expression that matches an item or items to be selected. Selection expressions follow the format of <project>/<system>. The wildcard * character matches any string of characters.
An expression with a prefix of ~ will be treated as negation. Expressions are processed in order, for example an expression set like this: /:~myproject/* will be read as “everything in the vault, except for systems under myproject”.
Here are some examples:
-
my-project/*
matches all systems under myproject. -
my-project
matches only my-project. -
my-*/* matches
all systems under any project starting with my-. -
*/*-1.0 matches
all systems whose name-version ends with 1.0. -
*/*
matches all systems in the vault. -
*
matches all projects in the vault. -
An empty expression matches nothing.
-
In order to support common platform conventions, may be used as a name delimiter as well as ; used as an expression delimiter.