blob: 1997895ae7b6d010d72f2833968ca430a25579ed [file] [log] [blame]
'\" t
.\" Title: cargo-update
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 1.5.8
.\" Date: 2018-12-23
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "CARGO\-UPDATE" "1" "2018-12-23" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
.nh
.ad l
.de URL
\fI\\$2\fP <\\$1>\\$3
..
.als MTO URL
.if \n[.g] \{\
. mso www.tmac
. am URL
. ad l
. .
. am MTO
. ad l
. .
. LINKSTYLE blue R < >
.\}
.SH "NAME"
cargo\-update \- Update dependencies as recorded in the local lock file
.SH "SYNOPSIS"
.sp
\fBcargo update [\fIOPTIONS\fP]\fP
.SH "DESCRIPTION"
.sp
This command will update dependencies in the \fBCargo.lock\fP file to the latest
version. It requires that the \fBCargo.lock\fP file already exists as generated
by commands such as \fBcargo\-build\fP(1) or \fBcargo\-generate\-lockfile\fP(1).
.SH "OPTIONS"
.SS "Update Options"
.sp
\fB\-p\fP \fISPEC\fP..., \fB\-\-package\fP \fISPEC\fP...
.RS 4
Update only the specified packages. This flag may be specified
multiple times. See \fBcargo\-pkgid\fP(1) for the SPEC format.
.sp
If packages are specified with the \fB\-p\fP flag, then a conservative update of
the lockfile will be performed. This means that only the dependency specified
by SPEC will be updated. Its transitive dependencies will be updated only if
SPEC cannot be updated without updating dependencies. All other dependencies
will remain locked at their currently recorded versions.
.sp
If \fB\-p\fP is not specified, all dependencies are updated.
.RE
.sp
\fB\-\-aggressive\fP
.RS 4
When used with \fB\-p\fP, dependencies of \fISPEC\fP are forced to update as well.
Cannot be used with \fB\-\-precise\fP.
.RE
.sp
\fB\-\-precise\fP \fIPRECISE\fP
.RS 4
When used with \fB\-p\fP, allows you to specify a specific version number to
set the package to. If the package comes from a git repository, this can
be a git revision (such as a SHA hash or tag).
.RE
.sp
\fB\-\-dry\-run\fP
.RS 4
Displays what would be updated, but doesn\(cqt actually write the lockfile.
.RE
.SS "Display Options"
.sp
\fB\-v\fP, \fB\-\-verbose\fP
.RS 4
Use verbose output. May be specified twice for "very verbose" output which
includes extra output such as dependency warnings and build script output.
May also be specified with the \fBterm.verbose\fP
.URL "https://doc.rust\-lang.org/cargo/reference/config.html" "config value" "."
.RE
.sp
\fB\-q\fP, \fB\-\-quiet\fP
.RS 4
No output printed to stdout.
.RE
.sp
\fB\-\-color\fP \fIWHEN\fP
.RS 4
Control when colored output is used. Valid values:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
\fBauto\fP (default): Automatically detect if color support is available on the
terminal.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
\fBalways\fP: Always display colors.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
\fBnever\fP: Never display colors.
.RE
.sp
May also be specified with the \fBterm.color\fP
.URL "https://doc.rust\-lang.org/cargo/reference/config.html" "config value" "."
.RE
.SS "Manifest Options"
.sp
\fB\-\-manifest\-path\fP \fIPATH\fP
.RS 4
Path to the \fBCargo.toml\fP file. By default, Cargo searches in the current
directory or any parent directory for the \fBCargo.toml\fP file.
.RE
.sp
\fB\-\-frozen\fP, \fB\-\-locked\fP
.RS 4
Either of these flags requires that the \fBCargo.lock\fP file is
up\-to\-date. If the lock file is missing, or it needs to be updated, Cargo will
exit with an error. The \fB\-\-frozen\fP flag also prevents Cargo from
attempting to access the network to determine if it is out\-of\-date.
.sp
These may be used in environments where you want to assert that the
\fBCargo.lock\fP file is up\-to\-date (such as a CI build) or want to avoid network
access.
.RE
.SS "Common Options"
.sp
\fB\-h\fP, \fB\-\-help\fP
.RS 4
Prints help information.
.RE
.sp
\fB\-Z\fP \fIFLAG\fP...
.RS 4
Unstable (nightly\-only) flags to Cargo. Run \fBcargo \-Z help\fP for
details.
.RE
.SH "ENVIRONMENT"
.sp
See \c
.URL "https://doc.rust\-lang.org/cargo/reference/environment\-variables.html" "the reference" " "
for
details on environment variables that Cargo reads.
.SH "EXIT STATUS"
.sp
0
.RS 4
Cargo succeeded.
.RE
.sp
101
.RS 4
Cargo failed to complete.
.RE
.SH "EXAMPLES"
.sp
.RS 4
.ie n \{\
\h'-04' 1.\h'+01'\c
.\}
.el \{\
. sp -1
. IP " 1." 4.2
.\}
Update all dependencies in the lockfile:
.sp
.if n .RS 4
.nf
cargo update
.fi
.if n .RE
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 2.\h'+01'\c
.\}
.el \{\
. sp -1
. IP " 2." 4.2
.\}
Update only specific dependencies:
.sp
.if n .RS 4
.nf
cargo update \-p foo \-p bar
.fi
.if n .RE
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 3.\h'+01'\c
.\}
.el \{\
. sp -1
. IP " 3." 4.2
.\}
Set a specific dependency to a specific version:
.sp
.if n .RS 4
.nf
cargo update \-p foo \-\-precise 1.2.3
.fi
.if n .RE
.RE
.SH "SEE ALSO"
.sp
\fBcargo\fP(1), \fBcargo\-generate\-lockfile\fP(1)