edit-pr
driver
pr-edit
does the background work for edit-pr
, including
error-checking and refiling newly edited Problem Reports, handling file
and database locks and deletion of PRs. It can be called interactively,
though it has no usable editing interface.
The usage for pr-edit
is:
pr-edit [ -l username | --lock=username ] [ -u | --unlockdb ] [ -L | --lockdb ] [ -U | --unlockdb ] [ -c | --check ] [ -C | --check-initial ] [ -s | --submit [ --show-prnum ] ] [ -a field | --append field=field ] [ -r field | --replace=field ] [ --delete-pr ] [ -R reason | --reason=reason ] [ -p process-id | --process=process-id ] [ -d databasename | --database=databasename ] [ -f filename | --filename=filename ] [ -V | --version ] [ -h | --help ] [ -v username | --user=username ] [ -w passwd | --passwd=passwd ] [ -H host | --host=host ] [ -P port | --port=port ] [ -D | --debug ] [ PR number ]
A lock is placed on a Problem Report while the PR is being edited.
The lock is simply a file in the locks subdirectory of the
gnats-adm directory of the database, with the name
gnats-id.lock, which contains the name of the
user who created the lock. user then “owns” the
lock, and must remove it before the PR can be locked again, even by the
same user1. If a PR is already
locked when you attempt to edit it, pr-edit
prints an error
message giving the name of the user who is currently editing the
PR.
If you do not specify PR number, pr-edit
reads from
standard input. You must specify PR number for the functions
which affect PR locks, --lock=username and
--unlock.
-L
--lockdb
--database
or -d
option. No PRs may be edited, created or deleted while the database is
locked. This option is generally used when editing the index file.
-U
--unlockdb
-c
--check
-C
--check-initial
--check
options are used to verify that a proposed PR's field
contents are valid. The PR is read in (either from stdin or a file
specified with --filename
), and its fields are compared against
the rules specified by the database configuration of the selected
database. Warnings are given for enumerated fields whose contents do
not contain one of the required values or fields that do not match
required regexps. --check-initial
is used to verify initial PRs,
rather than proposed edits of existing PRs.
-s
--submit
--show-prnum
--submit
option to display the PR
number associated with the submitted PR.
The following options require a PR number to be given.
--delete-pr
-l
username--lock=
username--process
or -p
option is also given, that process-id is
associated with the lock.
-u
--unlock
-a
field--append=
field-r
field--replace=
field--append
and --replace
are used to append or replace
content of a specific field within a PR. The new field content is read
in from stdin (or from the file specified with the --filename
option), and either appended or replaced to the specified field. The
field contents are verified for correctness before the PR is rewritten.
If the edit is successful, a zero exit status is returned. If the edit
failed, a non-zero exit status is returned, and the reasons for the
failure are printed to stdout.
-R
reason--reason=
reasonPR number
PR number
is specified with no other options, a
replacement PR is read in (either from stdin or the file specified with
--filename
). If the PR contents are valid and correct, the
existing PR is replaced with the new PR contents. If the edit is
successful, a zero exit status is re turned. If the edit failed, a
non-zero exit status is returned, and the reasons for the failure are
printed to stdout.
-d
database--database=
databasedefault
). This option overrides the database
specified in the GNATSDB environment variable.
-f
filename--filename=
filename--filename
is not
specified, the PR or field content is read in from stdin.
-h
--help
pr-edit
.
-V
--version
pr-edit
.
pr-edit
can edit PRs across a network, talking to a
remote gnatsd. The following options relate to network access:
-H
host--host=
host-P
port--port=
port-v
username--username=
username-w
password--passwd=
password-D
--debug