|
| 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. |
0 commit comments