2013-01-23 11:19:13 +10:00
|
|
|
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2013-01-15 23:57:03 +10:00
|
|
|
pub fn general() {
|
2013-10-13 18:48:47 -07:00
|
|
|
println("Usage: rustpkg [options] <cmd> [args..]
|
2013-01-15 23:57:03 +10:00
|
|
|
|
|
|
|
Where <cmd> is one of:
|
2013-07-11 18:20:31 -07:00
|
|
|
build, clean, do, info, install, list, prefer, test, uninstall, unprefer
|
2013-01-15 23:57:03 +10:00
|
|
|
|
|
|
|
Options:
|
|
|
|
|
|
|
|
-h, --help Display this message
|
2013-09-10 11:41:05 -07:00
|
|
|
--sysroot PATH Override the system root
|
2013-01-15 23:57:03 +10:00
|
|
|
<cmd> -h, <cmd> --help Display help for <cmd>");
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn build() {
|
2013-10-13 18:48:47 -07:00
|
|
|
println("rustpkg build [options..] [package-ID]
|
2013-01-15 23:57:03 +10:00
|
|
|
|
2013-06-26 17:42:24 -07:00
|
|
|
Build the given package ID if specified. With no package ID argument,
|
|
|
|
build the package in the current directory. In that case, the current
|
|
|
|
directory must be a direct child of an `src` directory in a workspace.
|
2013-01-15 23:57:03 +10:00
|
|
|
|
|
|
|
Options:
|
2013-09-10 11:41:05 -07:00
|
|
|
-c, --cfg Pass a cfg flag to the package script
|
|
|
|
--no-link Compile and assemble, but don't link (like -c in rustc)
|
|
|
|
--no-trans Parse and translate, but don't generate any code
|
|
|
|
--pretty Pretty-print the code, but don't generate output
|
|
|
|
--parse-only Parse the code, but don't typecheck or generate code
|
|
|
|
-S Generate assembly code, but don't assemble or link it
|
|
|
|
-S --emit-llvm Generate LLVM assembly code
|
|
|
|
--emit-llvm Generate LLVM bitcode
|
|
|
|
--linker PATH Use a linker other than the system linker
|
|
|
|
--link-args [ARG..] Extra arguments to pass to the linker
|
|
|
|
--opt-level=n Set the optimization level (0 <= n <= 3)
|
|
|
|
-O Equivalent to --opt-level=2
|
|
|
|
--save-temps Don't delete temporary files
|
|
|
|
--target TRIPLE Set the target triple
|
|
|
|
--target-cpu CPU Set the target CPU
|
|
|
|
-Z FLAG Enable an experimental rustc feature (see `rustc --help`)");
|
2013-01-15 23:57:03 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn clean() {
|
2013-10-13 18:48:47 -07:00
|
|
|
println("rustpkg clean
|
2013-01-15 23:57:03 +10:00
|
|
|
|
|
|
|
Remove all build files in the work cache for the package in the current
|
|
|
|
directory.");
|
|
|
|
}
|
|
|
|
|
2013-01-23 12:41:11 +10:00
|
|
|
pub fn do_cmd() {
|
2013-10-13 18:48:47 -07:00
|
|
|
println("rustpkg do <cmd>
|
2013-01-23 12:41:11 +10:00
|
|
|
|
|
|
|
Runs a command in the package script. You can listen to a command
|
|
|
|
by tagging a function with the attribute `#[pkg_do(cmd)]`.");
|
|
|
|
}
|
|
|
|
|
2013-01-26 18:35:10 +10:00
|
|
|
pub fn info() {
|
2013-10-13 18:48:47 -07:00
|
|
|
println("rustpkg [options..] info
|
2013-01-26 18:35:10 +10:00
|
|
|
|
|
|
|
Probe the package script in the current directory for information.
|
|
|
|
|
|
|
|
Options:
|
|
|
|
-j, --json Output the result as JSON");
|
|
|
|
}
|
|
|
|
|
2013-07-11 18:20:31 -07:00
|
|
|
pub fn list() {
|
2013-10-13 18:48:47 -07:00
|
|
|
println("rustpkg list
|
2013-07-11 18:20:31 -07:00
|
|
|
|
|
|
|
List all installed packages.");
|
|
|
|
}
|
|
|
|
|
2013-01-15 23:57:03 +10:00
|
|
|
pub fn install() {
|
2013-10-13 18:48:47 -07:00
|
|
|
println("rustpkg install [options..] [package-ID]
|
2013-01-15 23:57:03 +10:00
|
|
|
|
2013-07-24 18:39:25 -07:00
|
|
|
Install the given package ID if specified. With no package ID
|
|
|
|
argument, install the package in the current directory.
|
|
|
|
In that case, the current directory must be a direct child of a
|
|
|
|
`src` directory in a workspace.
|
2013-01-15 23:57:03 +10:00
|
|
|
|
|
|
|
Examples:
|
|
|
|
rustpkg install
|
2013-07-24 18:39:25 -07:00
|
|
|
rustpkg install github.com/mozilla/servo
|
|
|
|
rustpkg install github.com/mozilla/servo#0.1.2
|
2013-01-15 23:57:03 +10:00
|
|
|
|
|
|
|
Options:
|
2013-09-10 11:41:05 -07:00
|
|
|
-c, --cfg Pass a cfg flag to the package script
|
|
|
|
--emit-llvm Generate LLVM bitcode
|
|
|
|
--linker PATH Use a linker other than the system linker
|
|
|
|
--link-args [ARG..] Extra arguments to pass to the linker
|
|
|
|
--opt-level=n Set the optimization level (0 <= n <= 3)
|
|
|
|
-O Equivalent to --opt-level=2
|
|
|
|
--save-temps Don't delete temporary files
|
|
|
|
--target TRIPLE Set the target triple
|
|
|
|
--target-cpu CPU Set the target CPU
|
|
|
|
-Z FLAG Enable an experimental rustc feature (see `rustc --help`)");
|
2013-01-15 23:57:03 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn uninstall() {
|
2013-10-13 18:48:47 -07:00
|
|
|
println("rustpkg uninstall <id|name>[@version]
|
2013-01-19 19:59:19 +10:00
|
|
|
|
2013-01-23 16:38:05 +10:00
|
|
|
Remove a package by id or name and optionally version. If the package(s)
|
|
|
|
is/are depended on by another package then they cannot be removed.");
|
2013-01-15 23:57:03 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn prefer() {
|
2013-10-13 18:48:47 -07:00
|
|
|
println("rustpkg [options..] prefer <id|name>[@version]
|
2013-01-15 23:57:03 +10:00
|
|
|
|
|
|
|
By default all binaries are given a unique name so that multiple versions can
|
|
|
|
coexist. The prefer command will symlink the uniquely named binary to
|
2013-01-23 16:38:05 +10:00
|
|
|
the binary directory under its bare name. If version is not supplied, the
|
|
|
|
latest version of the package will be preferred.
|
2013-01-15 23:57:03 +10:00
|
|
|
|
|
|
|
Example:
|
|
|
|
export PATH=$PATH:/home/user/.rustpkg/bin
|
|
|
|
rustpkg prefer machine@1.2.4
|
|
|
|
machine -v
|
|
|
|
==> v1.2.4
|
|
|
|
rustpkg prefer machine@0.4.6
|
|
|
|
machine -v
|
|
|
|
==> v0.4.6");
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn unprefer() {
|
2013-10-13 18:48:47 -07:00
|
|
|
println("rustpkg [options..] unprefer <id|name>[@version]
|
2013-01-15 23:57:03 +10:00
|
|
|
|
|
|
|
Remove all symlinks from the store to the binary directory for a package
|
2013-01-19 19:59:19 +10:00
|
|
|
name and optionally version. If version is not supplied, the latest version
|
|
|
|
of the package will be unpreferred. See `rustpkg prefer -h` for more
|
|
|
|
information.");
|
2013-01-15 23:57:03 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn test() {
|
2013-10-13 18:48:47 -07:00
|
|
|
println("rustpkg [options..] test
|
2013-01-15 23:57:03 +10:00
|
|
|
|
2013-10-01 12:05:57 -07:00
|
|
|
Build all test crates in the current directory with the test flag.
|
|
|
|
Then, run all the resulting test executables, redirecting the output
|
|
|
|
and exit code.
|
2013-01-15 23:57:03 +10:00
|
|
|
|
|
|
|
Options:
|
|
|
|
-c, --cfg Pass a cfg flag to the package script");
|
|
|
|
}
|
2013-09-16 14:59:34 -07:00
|
|
|
|
|
|
|
pub fn init() {
|
2013-10-13 18:48:47 -07:00
|
|
|
println("rustpkg init
|
2013-09-16 14:59:34 -07:00
|
|
|
|
2013-09-19 12:53:38 -07:00
|
|
|
This will turn the current working directory into a workspace. The first
|
|
|
|
command you run when starting off a new project.
|
2013-09-16 14:59:34 -07:00
|
|
|
");
|
|
|
|
}
|