Skip to content

Searching

Barry-Thomas-Paul: Moss edited this page Jul 16, 2023 · 1 revision

CLI Searching

WILDCARDS

The search can include wildcards % and _.

  • % wildcard matches all characters
  • _ wildcard matches a single character

Escaping can be don by use of the -e --escape option

In this example the _ is escaped.

cli-hlp hlp -s "Some\\_value" -e "\\"

By default the -s has the wildcard % append on both sides. For instance -s "Some.Value" is the same as -s "%Some.Value%".

To exclude wildcards from being appended to -s searches use the -b ( no wildcard before ) and -a (no wildcard after). The -b and -a only apply to -s searches and not --exclude.

If you want to use wildcards in -x, --exclude they must be explicitly included.

SEARCH

Once your project is built and installed then command line interface searching is done by calling the name set in entry_point_name.

While still in development mode the CLI name is cli-hlp.

Searching has a number of options:

Running the following command will list the options.

$ cli-hlp hlp -h
usage: cli-hlp hlp [-h] -s SEARCH [-b] [-a] [-c] [-m LIMIT] [-x EXCLUDE]
                   [-r [{class,method,attribute,property,namedtuple,namedtuple-field,function,module,exception,data,protocol}]]
                   [-e ESCAPE]

options:
  -h, --help            show this help message and exit
  -s SEARCH, --search SEARCH
                        Search phrase. Multiple -s are permitted.
  -b, --no-before       No leading wildcard in search
  -a, --no-after        No trailing wildcard in search
  -c, --case-sensitive  Case sensitive search
  -m LIMIT, --max-results LIMIT
                        Limits the number of results returned: Default (default: 10)
  -x EXCLUDE, --exclude EXCLUDE
                        Optional: excludes from match. Multiple -x are permitted.
  -r [{class,method,attribute,property,namedtuple,namedtuple-field,function,module,exception,data,protocol}], --role [{class,method,attribute,property,namedtuple,namedtuple-field,function,module,exception,data,protocol}]
                        Select type of role
  -e ESCAPE, --escape ESCAPE
                        Escape Character. Used to escape % and _ characters in search. The value normally used when needed is \

Some options will vary depending on your configuration and if there is more then one objects.inv has been imported.

In most cases only the -s is needed. Other options are usually needed in edge cases.

The -s --search option can be included several times. This is useful if your not sure of a name and want to try more then one at a time.

cli-hlp hlp -s "Write.start" -s "Write.launch"

The -x --exclude option excludes from the search and can also be used multiple times. Note that the -x does not use wildcards unless you include them explicitly.

The -r --role option limits the search to a specific role.

Clone this wiki locally