Skip to content

Commit 890b0e8

Browse files
committed
Update install doc
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
1 parent 6351472 commit 890b0e8

File tree

4 files changed

+96
-0
lines changed

4 files changed

+96
-0
lines changed

src/doc/man/cargo-install.md

+3
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ See also the `--profile` option for choosing a specific profile by name.
185185

186186
{{#options}}
187187
{{> options-display }}
188+
189+
{{> options-message-format }}
190+
188191
{{/options}}
189192

190193
{{> section-options-common }}

src/doc/man/generated_txt/cargo-install.txt

+28
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,34 @@ OPTIONS
262262
May also be specified with the term.color config value
263263
<https://doc.rust-lang.org/cargo/reference/config.html>.
264264

265+
--message-format fmt
266+
The output format for diagnostic messages. Can be specified multiple
267+
times and consists of comma-separated values. Valid values:
268+
269+
o human (default): Display in a human-readable text format.
270+
Conflicts with short and json.
271+
272+
o short: Emit shorter, human-readable text messages. Conflicts with
273+
human and json.
274+
275+
o json: Emit JSON messages to stdout. See the reference
276+
<https://doc.rust-lang.org/cargo/reference/external-tools.html#json-messages>
277+
for more details. Conflicts with human and short.
278+
279+
o json-diagnostic-short: Ensure the rendered field of JSON messages
280+
contains the "short" rendering from rustc. Cannot be used with
281+
human or short.
282+
283+
o json-diagnostic-rendered-ansi: Ensure the rendered field of JSON
284+
messages contains embedded ANSI color codes for respecting
285+
rustc's default color scheme. Cannot be used with human or short.
286+
287+
o json-render-diagnostics: Instruct Cargo to not include rustc
288+
diagnostics in in JSON messages printed, but instead Cargo itself
289+
should render the JSON diagnostics coming from rustc. Cargo's own
290+
JSON diagnostics and others coming from rustc are still emitted.
291+
Cannot be used with human or short.
292+
265293
Common Options
266294
+toolchain
267295
If Cargo has been installed with rustup, and the first argument to

src/doc/src/commands/cargo-install.md

+25
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,31 @@ terminal.</li>
307307
<a href="../reference/config.html">config value</a>.</dd>
308308

309309

310+
311+
<dt class="option-term" id="option-cargo-install---message-format"><a class="option-anchor" href="#option-cargo-install---message-format"></a><code>--message-format</code> <em>fmt</em></dt>
312+
<dd class="option-desc">The output format for diagnostic messages. Can be specified multiple times
313+
and consists of comma-separated values. Valid values:</p>
314+
<ul>
315+
<li><code>human</code> (default): Display in a human-readable text format. Conflicts with
316+
<code>short</code> and <code>json</code>.</li>
317+
<li><code>short</code>: Emit shorter, human-readable text messages. Conflicts with <code>human</code>
318+
and <code>json</code>.</li>
319+
<li><code>json</code>: Emit JSON messages to stdout. See
320+
<a href="../reference/external-tools.html#json-messages">the reference</a>
321+
for more details. Conflicts with <code>human</code> and <code>short</code>.</li>
322+
<li><code>json-diagnostic-short</code>: Ensure the <code>rendered</code> field of JSON messages contains
323+
the &quot;short&quot; rendering from rustc. Cannot be used with <code>human</code> or <code>short</code>.</li>
324+
<li><code>json-diagnostic-rendered-ansi</code>: Ensure the <code>rendered</code> field of JSON messages
325+
contains embedded ANSI color codes for respecting rustc's default color
326+
scheme. Cannot be used with <code>human</code> or <code>short</code>.</li>
327+
<li><code>json-render-diagnostics</code>: Instruct Cargo to not include rustc diagnostics in
328+
in JSON messages printed, but instead Cargo itself should render the
329+
JSON diagnostics coming from rustc. Cargo's own JSON diagnostics and others
330+
coming from rustc are still emitted. Cannot be used with <code>human</code> or <code>short</code>.</li>
331+
</ul></dd>
332+
333+
334+
310335
</dl>
311336

312337
### Common Options

src/etc/man/cargo-install.1

+40
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,46 @@ terminal.
342342
May also be specified with the \fBterm.color\fR
343343
\fIconfig value\fR <https://doc.rust\-lang.org/cargo/reference/config.html>\&.
344344
.RE
345+
.sp
346+
\fB\-\-message\-format\fR \fIfmt\fR
347+
.RS 4
348+
The output format for diagnostic messages. Can be specified multiple times
349+
and consists of comma\-separated values. Valid values:
350+
.sp
351+
.RS 4
352+
\h'-04'\(bu\h'+02'\fBhuman\fR (default): Display in a human\-readable text format. Conflicts with
353+
\fBshort\fR and \fBjson\fR\&.
354+
.RE
355+
.sp
356+
.RS 4
357+
\h'-04'\(bu\h'+02'\fBshort\fR: Emit shorter, human\-readable text messages. Conflicts with \fBhuman\fR
358+
and \fBjson\fR\&.
359+
.RE
360+
.sp
361+
.RS 4
362+
\h'-04'\(bu\h'+02'\fBjson\fR: Emit JSON messages to stdout. See
363+
\fIthe reference\fR <https://doc.rust\-lang.org/cargo/reference/external\-tools.html#json\-messages>
364+
for more details. Conflicts with \fBhuman\fR and \fBshort\fR\&.
365+
.RE
366+
.sp
367+
.RS 4
368+
\h'-04'\(bu\h'+02'\fBjson\-diagnostic\-short\fR: Ensure the \fBrendered\fR field of JSON messages contains
369+
the "short" rendering from rustc. Cannot be used with \fBhuman\fR or \fBshort\fR\&.
370+
.RE
371+
.sp
372+
.RS 4
373+
\h'-04'\(bu\h'+02'\fBjson\-diagnostic\-rendered\-ansi\fR: Ensure the \fBrendered\fR field of JSON messages
374+
contains embedded ANSI color codes for respecting rustc's default color
375+
scheme. Cannot be used with \fBhuman\fR or \fBshort\fR\&.
376+
.RE
377+
.sp
378+
.RS 4
379+
\h'-04'\(bu\h'+02'\fBjson\-render\-diagnostics\fR: Instruct Cargo to not include rustc diagnostics in
380+
in JSON messages printed, but instead Cargo itself should render the
381+
JSON diagnostics coming from rustc. Cargo's own JSON diagnostics and others
382+
coming from rustc are still emitted. Cannot be used with \fBhuman\fR or \fBshort\fR\&.
383+
.RE
384+
.RE
345385
.SS "Common Options"
346386
.sp
347387
\fB+\fR\fItoolchain\fR

0 commit comments

Comments
 (0)