Command-Line Syntax and Options


CVS supports a number of command-line options that you can use to control various aspects of CVS behavior. Each CVS subcommand has its own options, as well.

The syntax of any CVS command is as follows:

        cvs [cvs-options] [command] [command-options-and-arguments]

The cvs-options modify the behavior of the main CVS code, rather than the code for a specific command.

cvs Options

Options to the cvs command are supplied before the particular subcommand to be executed. This section focuses on options that you pass to the cvs executable itself, not to any specific CVS command. The following options are valid:


-a

Authenticate all network traffic. Without this option, the initial connection for the command is authenticated, but later traffic along the same data stream is assumed to be from the same source.

This option is available only with GSS-API connections, but if you use ssh as your rsh replacement in the ext connection mode, ssh authenticates the data stream.

This option is supported if it is listed in cvs --help-options. The command-line client can be compiled to support it by using the --enable-client option to the configure script.


-allow-root=directory

Used as part of the inetd command string for the server, kserver, and pserver connection methods. The directory is the repository root directory to which the server allows connections. Using --allow-root more than once in a command allows users to connect to any of the specified repositories.


d repository_path

Use repository_path as the path to the repository root directory. This option overrides both the CVSROOT environment variable and the contents of the Root file in the sandbox's CVS subdirectory. It also overrides the contents of the .cvsrc file.

The syntax for the repository path is:

 [:method:][[[user][:password]@]hostname[:[port]]]/path

See Essential CVS (O'Reilly) for a full explanation of each element of the repository path.


e editor

Use the specified editor when CVS calls an editor for log information during the commit or import process. This option overrides the EDITOR, CVSEDITOR, and VISUAL environment variables, and the contents of the .cvsrc file.


-f

Prevent CVS from reading the ~/.cvsrc file and using the options in it.


H, --help

If called as cvs -H or cvs --help, CVS displays a general CVS help message.

If called as cvs -H command or cvs --help command, CVS displays the available options and help information for the specified command.


-help-commands

List the available CVS commands with brief descriptions of their purposes.


-help-options

List the available cvs-options with brief descriptions of their purposes.


-help-synonyms

List the valid synonyms (short names) for the CVS commands.


-l

Do not log the current command to the history file in the repository's CVSROOT directory. The command will not show in subsequent cvs history output.


-n

Execute only commands that do not change the repository. Using this option with cvs update can provide a status report on the current sandbox.


-q

Run in quiet mode. This option causes CVS to display only some of the informational messages.


-Q

Run in very quiet mode. This option causes CVS to display only the most critical information.


-r

Set files checked out to the sandbox as read-only. This option only sets newly checked-out files. If a file is being watched with cvs watch, read-only is the default. This option overrides settings in the .cvsrc file.


s variable=value

Set a user variable for use with one of the scripting files in CVSROOT. The user variables are explained in CVSROOT Variables," later in this chapter.


-t

Display messages that trace the execution of the command. This option can be used with -n to determine precisely what a command does.


T directory

Use the named directory to store temporary files. This option overrides environment variables or settings in the .cvsrc file.


v, --version

Display CVS version and copyright information.


-w

Set files checked out to the sandbox as readable and writable. This option sets only the permissions of newly checked-out files. This option overrides the CVSREAD environment variable, and it overrides settings in the .cvsrc file.


-x

Encrypt all data that travels across the network between the client and the server. This option is currently available in GSS-API or Kerberos mode only, but if you use ssh as your rsh replacement in the ext connection mode, ssh encrypts the data stream.

This option is available only if the client supports it. It is supported if it is listed in cvs --help-options. You can compile the command-line client to support it by using the --enable-client and --enable-encryption options to the configure script.


z n

Compress all network traffic by using the specified gzip compression level n. The compression levels range from 0 (no compression) to 9 (maximum compression). This option overrides settings in the .cvsrc file.

This option is available only if the client supports it. It is supported if it is listed in cvs --help-options. You can compile the command-line client to support it by using the --enable-client option to the configure script.

Common Subcommand Options

Many of the CVS subcommands (add, commit, and so on) share a large number of common options. They are described here.


d directory-name

Check out or update a sandbox out into a directory called directory-name instead of using the repository directory name or the name designated in the modules file in the repository's CVSROOT directory. This is particularly useful when creating a second sandbox for a project.

CVS usually creates the same directory structure that the repository uses. However, if the checkout parameter contains only one file or directory and the -d option is used, CVS does not create any intervening directories. Use -N to prevent CVS from shortening the path.


D date

Run the subcommand on the latest revision of a file that is as old as or older than the date or time specified by date.


-f

Use the latest (HEAD) revision of a file that is on the current branch or trunk if no revision matches a specified date or revision number. This option applies only if -r or -D is used.


k mode

Specify the keyword expansion mode. For cvs add, this option also sets the default keyword mode for the file. If you forget to set the default keyword mode with cvs add, you can do so later with cvs admin. The keyword-expansion modes are listed in Keywords and Keyword Modes," later in this chapter


-l

Run the subcommand on the files in the local directory only. (Do not recurse into subdirectories.) See also -R.


m message

Use the specified message as the description of the newly added file or as the description of the change made.


-n

Do not run any program listed in the modules file for this directory.


-N

Do not shorten the path. CVS usually creates the same directory structure that the repository uses. However, if the checkout contains only one file and the -d option is used, CVS does not create any intervening directories unless -N is also specified.


r revision

Run the subcommand on the specified revision or tag of a file. If this option refers to a branch, run the command on the latest (HEAD) revision of the branch.


-R

Run the subcommand on the files in the local directory and all subdirectories and recurse down the subdirectories. This option is generally the default. See also -l.



Linux in a Nutshell
Linux in a Nutshell
ISBN: 0596154488
EAN: 2147483647
Year: 2004
Pages: 147

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net