Skip to content

Commit 8ee2d58

Browse files
committed
Give the rust tool an own section in the tutorial.
1 parent f684a8a commit 8ee2d58

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

doc/tutorial.md

+21-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ for more information on them.
115115
When complete, `make install` will place several programs into
116116
`/usr/local/bin`: `rustc`, the Rust compiler; `rustdoc`, the
117117
API-documentation tool; `rustpkg`, the Rust package manager;
118-
`rusti`, the Rust REPL; and `rust`, a tool which acts as a unified way to
119-
call them, either directly or with common command line arguments.
118+
`rusti`, the Rust REPL; and `rust`, a tool which acts both as a unified
119+
interface for them, and for a few common command line scenarios.
120120

121121
[wiki-start]: https://github.com./mozilla/rust/wiki/Note-getting-started-developing-Rust
122122
[tarball]: http://static.rust-lang.org/dist/rust-0.5.tar.gz
@@ -155,6 +155,25 @@ declaration to appear at the top level of the file: all statements must
155155
live inside a function. Rust programs can also be compiled as
156156
libraries, and included in other programs.
157157

158+
## Using the rust tool
159+
160+
While using `rustc` directly to generate your executables, and then
161+
running them manually is a perfectly valid way to test your code,
162+
for smaller projects, prototypes, or if you're a beginner, it might be
163+
more convenient to use the `rust` tool.
164+
165+
You use it by calling it with one of the supported commands, followed by
166+
arguments for that command. For example `rust build foo.rs` calls the
167+
`build` command with the argument `foo.rs`.
168+
169+
The commands are:
170+
- `build`, `doc`, `pkg` and `sketch`, which simply forward all arguments
171+
to the included programs `rustc`, `rustdoc`, `rustpkg` and `rusti`.
172+
- `run` and `test`, which both accept one source file and, using `rustc`,
173+
produce either a normal or a test executable in the current working
174+
directory and run it.
175+
- `help`, which prints out the usage text of one of the commands.
176+
158177
## Editing Rust code
159178

160179
There are vim highlighting and indentation scripts in the Rust source

0 commit comments

Comments
 (0)