Next: Formatting query-pr output, Up: query-pr [Contents][Index]
query-prFrom the shell, simply type query-pr, followed by any search
parameters you wish to exercise. From Emacs, type M-x query-pr. query-pr prompts you for search parameters in the
minibuffer.
query-pr can also be accessed by electronic mail, if your version
of GNATS is configured for this. To use this feature, simply send
mail to the address ‘query-pr@your-site’ with command
line arguments or options in the Subject line of the mail header.
GNATS replies to your mail with the results of your query. The
default settings for the query-pr mail server are
--restricted --state="open|analyzed|feedback|suspended"
To override the --state parameter, specify
--state=state in the Subject line of the mail
header. You can not query on confidential Problem Reports by mail.
The usage for query-pr is:
query-pr [--debug | -D] [--help | -h] [--version | -V]
[--output file | -o file] [--list-databases]
[--list-fields] [--list-input-fields]
[--responsible-address name] [--field-type field]
[--field-description field]
[--field-flags field]
[--adm-field field] [--adm-subfield subfield]
[--adm-key key]
[--valid-values field]
[--format format | -f format]
[--full | -F] [--summary | -q]
[--database database | -d database] [--and | -&]
[--or | -|] [--expr expr] [PR Number]
Non-network-mode options:
[--print-sh-vars] [--print-directory-for-database]
Network-mode-only options:
[--host host | -H host] [--port port]
[--user user | -v user] [--passwd passwd | -w passwd]
[--print-server-addr]
Deprecated Options:
[--list-categories | -j] [--list-states | -T]
[--list-responsible | -k] [--list-submitters | -l]
[--category category | -c category]
[--synopsis synopsis | -y synopsis]
[--confidential confidential | -C confidential]
[--multitext multitext | -m multitext]
[--originator originator | -O originator]
[--release release | -A release]
[--class class | -L class] [--cases cases | -E cases]
[--quarter quarter | -Q quarter]
[--keywords keywords | -K keywords]
[--priority priority | -p priority]
[--responsible responsible | -r responsible]
[--restricted | -R] [--severity severity | -e severity]
[--skip-closed | -x] [--sql | -i] [--sql2 | -I]
[--state state | -s state]
[--submitter submitter | -S submitter]
[--text text | -t text]
[--required-before date | -u date]
[--required-after date | -U date]
[--arrived-before date | -b date]
[--arrived-after date | -a date]
[--modified-before date | -B date]
[--modified-after date | -M date]
[--closed-before date | -z date]
[--closed-after date | -Z date]
The options have the following meaning:
--help, -hPrints a help message.
--version, -VDisplays the program version to stdout.
--output file, -o fileThe results of the query will be placed in this file.
--database database, -d databaseSpecifies the database to be used for the query. If no database is
specified, the database named default is assumed. (This option
overrides the database specified in the GNATSDB environment
variable; see Environment for more
information.)
--list-categories, -jLists the available PR categories for the selected database.
--list-states, -TLists the valid PR states for PRs in this database.
--list-responsible, -kLists the users that appear in the database’s responsible list.
--list-submitters, -lLists the valid submitters for this database.
The previous –list-* options are deprecated and may be removed in future releases of GNATS; their functionality can be replaced with
query-pr --valid-values field
where field is one of Category, Class,
Responsible, Submitter-Id, or State.
--list-databasesLists the known databases.
--list-fieldsLists the entire set of field names for PRs in the selected database.
--list-input-fieldsLists the fields that should be provided when creating a new PR for the currently-specified database. The fields are listed in an order that would make sense when used in a template or form.
--field-type fieldReturns the data type contained in PR field field. The current set of data types includes ‘text’, ‘multitext’, ‘enum’, ‘multienum’, ‘enumerated-in-file’, ‘multi-enumerated-in-file’, ‘date’ and ‘integer’.
--field-description fieldReturns a human-readable description of the intended purpose of field.
--field-flags fieldReturns the flags set for the field in the dbconfig file
associated with the database, such as textsearch and
readonly. See Individual field configuration.
--adm-field fieldUsed together with the --adm-key option, this returns a record
from the administrative file (if any) associated with the field. For
more material on administrative files, see Enumerated field administrative files.
--adm-subfield subfieldUsed together with the --adm-field and --adm-key options,
this returns the contents of a particular subfield from the record
specified by --adm-field and --adm-key. Subfields are
treated in Enumerated field administrative
files.
--adm-key keyUsed together with --adm-field to select a record from the
administrative file associated with the field specified by
--adm-field. See Enumerated field administrative files.
--valid-values fieldFor fields of type ‘enum’, a list of valid values (one per line) is returned. Otherwise, a regular expression is returned that describes the legal values in field.
--responsible-address nameThe mail address of name is returned; name is assumed to be a name either appearing in the database’s responsible list, or is otherwise a user on the system.
--print-sh-varsA set of /bin/sh variables is returned that describe the selected database. They include:
GNATSDBThe name of the currently-selected database.
GNATSDB_VALIDSet to 1 if the selected database is valid.
GNATSDBDIRThe directory where the database contents are stored.
DEBUG_MODESet to 1 if debug mode has been enabled for the database.
DEFAULTCATEGORYThe default category for PRs in the database.
DEFAULTSTATEThe default state for PRs in the database.
--print-server-addrPrints the information about a remote server database in the format
suitable for the GNATSDB environment variable. This option
works only in the network mode.
--print-directory-for-databaseReturns the directory where the selected database is located.
--format format, -f formatUsed to specify the format of the output PRs, See Formatting query-pr output for a complete description.
--full, -FWhen printing PRs, the entre PR is displayed. This is exactly equivalent to
query-pr --format full
--summary, -qWhen printing PRs, a summary format is used. This is exactly equivalent to
query-pr --format summary
--debug, -DEnables debugging output for network queries.
--host host, -H hostSpecifies the hostname of the gnatsd server to communicate with. This
overrides the value in the GNATSDB environment variable.
--port portSpecifies the port number of the gnatsd server to communicate with.
This overrides the value in the GNATSDB environment variable.
--user user, -v userSpecifies the username to login with when connecting to the gnatsd
server. This overrides the value in the GNATSDB environment
variable.
--passwd passwd, -w passwdSpecifies the password to login with when connecting to the gnatsd
server. This overrides the value in the GNATSDB environment
variable.
--and, -&, --or, -|These options are used when connecting multiple query operators together. They specify whether the previous and subsequent options are to be logically ANDed or logically ORed.
--expr exprSpecifies a query expression to use when searching for PRs. See Query expressions.
The remaining deprecated options are not described here, since their use
is fairly obvious and their functionality is completely replaced by the
use of the --expr option.
Next: Formatting query-pr output, Up: query-pr [Contents][Index]