find
Command Reference
Description
Find objects matching name and type
Queries the model for objects matching the specified name and type. Query results can be presented in several output formats.
Inspired by ProjectBuilder#find-objects
static: This command can be run outside of an object context.
Usage
ctl -m modelutil -c find -depot <> [-format <properties>] [-name <.*>] [-output <>] [-type <.*>] [-useregex <true>]
Options
Option | Description | Type | Default |
---|---|---|---|
depot | project depot name | string | ${context.depot} |
format |
output format. properties,xml,maprefuri
|
string | properties |
name | object name (or regex) | string | .* |
output | Output file | string | |
type |
type name (or regex)
If the regex parameter is not specified, then all objects of this type are matched. This means any object that is also a subtype. |
string | .* |
useregex | Use regexes to match object name and type | string | true |
Examples
Find all Setting objects and save the output as Java properties (the default format). This will return all objects that are Setting subtypes and save it in the file "/tmp/find.out".
ctl -p demo -m modelutil -c find -- -type Setting -output /tmp/find.out
Find also lets you specify the name and type as a regular expression.
This example will find all objects that have a name that begins with the pattern "my.*" and any type matching the pattern "*.Service. The results are written to the console.
ctl -p demo -m modelutil -c find -- -name myservice -regex true