Skip to content

Commit e95fcfa

Browse files
committed
auto merge of #7632 : gavinb/rust/7484_manpages, r=cmr
This patch updates the existing manpage and creates new pages for all of the rust command line tools. Closes #7484.
2 parents 323ac99 + 50600c3 commit e95fcfa

File tree

6 files changed

+460
-4
lines changed

6 files changed

+460
-4
lines changed

man/rust.1

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
.TH RUST "1" "July 2013" "rust 0.7" "User Commands"
2+
.SH NAME
3+
rust \- a front-end to the Rust toolchain
4+
.SH SYNOPSIS
5+
.B rust
6+
[\fICOMMAND\fR] [\fIOPTIONS\fR] \fIINPUT\fR
7+
8+
.SH DESCRIPTION
9+
This tool is a front-end for the Rust language, available at
10+
<\fBhttps://www.rust-lang.org\fR>. It provides commands to
11+
run, test and package Rust programs.
12+
13+
.SH COMMANDS
14+
15+
.TP
16+
\fBbuild\fR
17+
compile rust source files
18+
.TP
19+
\fBrun\fR
20+
build an executable, and run it
21+
.TP
22+
\fBtest\fR
23+
build a test executable, and run it
24+
.TP
25+
\fBdoc\fR
26+
generate documentation from doc comments
27+
.TP
28+
\fBpkg\fR
29+
download, build, install rust packages
30+
.TP
31+
\fBsketch\fR
32+
run a rust interpreter
33+
.TP
34+
\fBhelp\fR
35+
show detailed usage of a command
36+
37+
The build, run and test commands take the same parameters
38+
as the rustc command.
39+
40+
.SS "BUILD COMMAND"
41+
42+
The \fBbuild\fR command is a shortcut for the \fBrustc\fR command line.
43+
All options will be passed to the compiler verbatim. For example, to build
44+
an optimised version:
45+
46+
$ rust build -O <filename>
47+
48+
.SS "RUN COMMAND"
49+
50+
The \fBrun\fR command is a shortcut for the \fBrustc\fR command line.
51+
All options will be passed to the compiler verbatim, and if the compilation
52+
is successful, the resultant executable will be invoked. For example, to
53+
build and run an optimised version:
54+
55+
$ rust run -O <filename>
56+
57+
.SS "TEST COMMAND"
58+
59+
The \fBtest\fR command is a shortcut for the command line:
60+
61+
$ rustc --test <filename> -o <filestem>test~ && ./<filestem>test~
62+
63+
.SS "DOC COMMAND"
64+
65+
The \fBdoc\fR command is an alias for the rustdoc program. It is equivalent to:
66+
67+
$ rustdoc [options] <cratefile>
68+
69+
.SS "PKG COMMAND"
70+
71+
The \fBpkg\fR command is an alias for the rustpkg program. It is equivalent to:
72+
73+
$ rustpkg [options] <cratefile>
74+
75+
.SS "SKETCH COMMAND"
76+
77+
The \fBsketch\fR command launches the \fBrusti\fR interactive shell.
78+
79+
.SS "HELP COMMAND"
80+
81+
The \fBhelp\fR command displays a summary of available commands (ie. this text).
82+
83+
.SH "EXAMPLES"
84+
85+
To build an executable (with a main function):
86+
$ rust build hello.rs
87+
88+
To build a library from a source file:
89+
$ rust build --lib hello-lib.rs
90+
91+
To build and run an executable:
92+
$ rust run hello.rs
93+
94+
To build an executable with unit tests and execute the tests:
95+
$ rust test hello.rs
96+
97+
To create a package
98+
99+
.SH "SEE ALSO"
100+
rustc, rustdoc, rustpkg, rusti
101+
102+
.SH "BUGS"
103+
See <\fBhttps://github.com/mozilla/rust/issues\fR> for issues.
104+
105+
.SH "AUTHOR"
106+
See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
107+
<\fI[email protected]\fR> is the project leader.
108+
109+
.SH "COPYRIGHT"
110+
This work is dual-licensed under Apache 2.0 and MIT terms. See \fBCOPYRIGHT\fR
111+
file in the rust source distribution.

man/rustc.1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ Build a test harness
8686
\fB\-\-target\fR TRIPLE
8787
Target triple cpu-manufacturer-kernel[-os] to compile for (see
8888
http://sources.redhat.com/autobook/autobook/autobook_17.html
89-
for detail)
89+
for details)
9090
.TP
9191
\fB\-\-target-feature\fR TRIPLE
92-
Target-specific attributes (see llc -mattr=help for detail)
92+
Target-specific attributes (see llc -mattr=help for details)
9393
.TP
9494
\fB\-\-android-cross-path\fR PATH
9595
The path to the Android NDK
@@ -128,6 +128,9 @@ To build either with a crate (.rc) file:
128128
To build an executable with debug info (experimental):
129129
$ rustc -Z debug-info -o hello hello.rs
130130

131+
.SH "SEE ALSO"
132+
133+
rust, rustdoc, rustpkg, rusti
131134

132135
.SH "BUGS"
133136
See <\fBhttps://github.com/mozilla/rust/issues\fR> for issues.

man/rustdoc.1

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
.TH RUSTDOC "1" "July 2013" "rustdoc 0.7" "User Commands"
2+
.SH NAME
3+
rustdoc \- generate documentation from Rust source code
4+
.SH SYNOPSIS
5+
.B rustdoc
6+
[\fIOPTIONS\fR] \fICRATEFILE\fR
7+
8+
.SH DESCRIPTION
9+
This tool generates API reference documentation by extracting comments from
10+
source code written in the Rust language, available at <\fBhttps://www.rust-
11+
lang.org\fR>. It provides several output formats for the generated
12+
documentation.
13+
14+
.SH COMMANDS
15+
16+
.TP
17+
--output-dir <val>
18+
Put documents here (default: .)
19+
.TP
20+
--output-format <val>
21+
markdown or html (default: html)
22+
.TP
23+
--output-style <val>
24+
doc-per-crate or doc-per-mod (default: doc-per-mod)
25+
.TP
26+
--pandoc-cmd <val>
27+
Command for running pandoc
28+
.TP
29+
-h, --help
30+
Print help
31+
32+
.SH "OUTPUT FORMATS"
33+
34+
The rustdoc tool can generate documentation in either the Markdown
35+
or HTML formats. It requires the pandoc tool
36+
<\fBhttp://johnmacfarlane.net/pandoc/\fR> for conversion features.
37+
38+
.SH "EXAMPLES"
39+
40+
To generate documentation for the source in the current directory:
41+
$ rustdoc hello.rs
42+
43+
To build documentation into a subdirectory named 'doc' in the Markdown
44+
format:
45+
$ rustdoc --output-dir doc --output-format markdown hello.rs
46+
47+
The generated HTML can be viewed with any standard web browser, while
48+
the Markdown version is well-suited for conversion into other formats.
49+
50+
.SH "SEE ALSO"
51+
52+
rust, rustc, rustpkg, rusti
53+
54+
.SH "BUGS"
55+
See <\fBhttps://github.com/mozilla/rust/issues\fR> for issues.
56+
57+
.SH "AUTHOR"
58+
See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
59+
<\fI[email protected]\fR> is the project leader.
60+
61+
.SH "COPYRIGHT"
62+
This work is dual-licensed under Apache 2.0 and MIT terms. See \fBCOPYRIGHT\fR
63+
file in the rust source distribution.

man/rusti.1

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
.TH RUSTI "1" "July 2013" "rusti 0.7" "User Commands"
2+
\" Macros
3+
..
4+
.de Vb \" Begin verbatim text
5+
.ft CW
6+
.nf
7+
.ne \\$1
8+
..
9+
.de Ve \" End verbatim text
10+
.ft R
11+
.fi
12+
..
13+
.SH NAME
14+
rusti \- Rust interactive shell
15+
16+
.SH SYNOPSIS
17+
.B rusti
18+
19+
.SH DESCRIPTION
20+
21+
This program is a REPL (Read-Eval-Print Loop) for the Rust language, available
22+
at <\fBhttps://www.rust-lang.org\fR>. It provides an interactive shell to
23+
evaluate Rust expressions, functions and code snippets, and to experiment with
24+
Rust code.
25+
26+
.B WARNING:
27+
The Rust REPL is experimental and may be unstable. If you encounter problems,
28+
please use the compiler instead.
29+
30+
.SH OPTIONS
31+
32+
Currently none.
33+
34+
.SH SPECIAL COMMANDS
35+
36+
The interactive shell evaluates all input as a sequence of Rust expressions,
37+
except for a set of special commands prefixed by a colon ':'. These special
38+
commands are described below:
39+
40+
.TP
41+
\fB:help\fR
42+
Display a summary of available commands.
43+
.TP
44+
\fB:{\\n ..lines.. \\n:}\\n\fR
45+
execute multiline command
46+
.TP
47+
\fB:load <crate> ...\fR
48+
loads given crates as dynamic libraries
49+
.TP
50+
\fB:clear\fR
51+
clear the bindings
52+
.TP
53+
\fB:exit\fR
54+
exit from the repl
55+
56+
.SH "EXAMPLES"
57+
58+
A simple example session, declaring a variable, defining a function,
59+
evaluating an expression and printing the result:
60+
61+
.PP
62+
.Vb
63+
\& \fBrusti>\fR let x = 42;
64+
\& \fBrusti>\fR fn square(n: int) -> int { n*n }
65+
\& \fBrusti>\fR println(fmt!("%d squared is %d", x, square(x)));
66+
\& 42 squared is 1764
67+
.Ve
68+
69+
.SH "SEE ALSO"
70+
71+
rust, rustc, rustdoc, rustpkg
72+
73+
.SH "BUGS"
74+
See <\fBhttps://github.com/mozilla/rust/issues\fR> for issues.
75+
76+
.SH "AUTHOR"
77+
See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
78+
<\fI[email protected]\fR> is the project leader.
79+
80+
.SH "COPYRIGHT"
81+
This work is dual-licensed under Apache 2.0 and MIT terms. See \fBCOPYRIGHT\fR
82+
file in the rust source distribution.

0 commit comments

Comments
 (0)