|
| 1 | +use core::io; |
| 2 | + |
| 3 | +pub fn general() { |
| 4 | + io::println(~"Usage: rustpkg [options] <cmd> [args..] |
| 5 | + |
| 6 | +Where <cmd> is one of: |
| 7 | + build, clean, install, prefer, test, uninstall, unprefer |
| 8 | + |
| 9 | +Options: |
| 10 | + |
| 11 | + -h, --help Display this message |
| 12 | + <cmd> -h, <cmd> --help Display help for <cmd>"); |
| 13 | +} |
| 14 | +
|
| 15 | +pub fn build() { |
| 16 | + io::println(~"rustpkg [options..] build |
| 17 | + |
| 18 | +Build all targets described in the package script in the current |
| 19 | +directory. |
| 20 | + |
| 21 | +Options: |
| 22 | + -c, --cfg Pass a cfg flag to the package script"); |
| 23 | +} |
| 24 | + |
| 25 | +pub fn clean() { |
| 26 | + io::println(~"rustpkg clean |
| 27 | + |
| 28 | +Remove all build files in the work cache for the package in the current |
| 29 | +directory."); |
| 30 | +} |
| 31 | + |
| 32 | +pub fn install() { |
| 33 | + io::println(~"rustpkg [options..] install [url] [target] |
| 34 | + |
| 35 | +Install a package from a URL by Git or cURL (FTP, HTTP, etc.). |
| 36 | +If target is provided, Git will checkout the branch or tag before |
| 37 | +continuing. If the URL is a TAR file (with or without compression), |
| 38 | +extract it before installing. If a URL isn't provided, the package will |
| 39 | +be built and installed from the current directory (which is |
| 40 | +functionally the same as `rustpkg build` and installing the result). |
| 41 | + |
| 42 | +Examples: |
| 43 | + rustpkg install |
| 44 | + rustpkg install git://github.com/mozilla/servo.git |
| 45 | + rustpkg install git://github.com/mozilla/servo.git v0.1.2 |
| 46 | + rustpkg install http://rust-lang.org/hello-world-0.3.4.tar.gz |
| 47 | + |
| 48 | +Options: |
| 49 | + -c, --cfg Pass a cfg flag to the package script |
| 50 | + -p, --prefer Prefer the package after installing |
| 51 | + (see `rustpkg prefer -h`)"); |
| 52 | +} |
| 53 | + |
| 54 | +pub fn uninstall() { |
| 55 | + io::println(~"rustpkg uninstall <name>[@version] |
| 56 | + |
| 57 | +Remove a package by name and/or version. If version is omitted then all |
| 58 | +versions of the package will be removed. If the package[s] is/are depended |
| 59 | +on by another package then they cannot be removed. If the package is preferred |
| 60 | +(see `rustpkg prefer -h`), it will attempt to prefer the next latest |
| 61 | +version of the package if another version is installed, otherwise it'll remove |
| 62 | +the symlink."); |
| 63 | +} |
| 64 | + |
| 65 | +pub fn prefer() { |
| 66 | + io::println(~"rustpkg [options..] prefer <name>[@version] |
| 67 | + |
| 68 | +By default all binaries are given a unique name so that multiple versions can |
| 69 | +coexist. The prefer command will symlink the uniquely named binary to |
| 70 | +the binary directory under its bare name. The user will need to confirm |
| 71 | +if the symlink will overwrite another. If version is not supplied, the latest |
| 72 | +version of the package will be preferred. |
| 73 | + |
| 74 | +Example: |
| 75 | + export PATH=$PATH:/home/user/.rustpkg/bin |
| 76 | + rustpkg prefer machine@1.2.4 |
| 77 | + machine -v |
| 78 | + ==> v1.2.4 |
| 79 | + rustpkg prefer machine@0.4.6 |
| 80 | + machine -v |
| 81 | + ==> v0.4.6"); |
| 82 | +} |
| 83 | + |
| 84 | +pub fn unprefer() { |
| 85 | + io::println(~"rustpkg [options..] unprefer <name> |
| 86 | + |
| 87 | +Remove all symlinks from the store to the binary directory for a package |
| 88 | +name. See `rustpkg prefer -h` for more information."); |
| 89 | +} |
| 90 | + |
| 91 | +pub fn test() { |
| 92 | + io::println(~"rustpkg [options..] test |
| 93 | + |
| 94 | +Build all targets described in the package script in the current directory |
| 95 | +with the test flag. The test bootstraps will be run afterwards and the output |
| 96 | +and exit code will be redirected. |
| 97 | + |
| 98 | +Options: |
| 99 | + -c, --cfg Pass a cfg flag to the package script"); |
| 100 | +} |
0 commit comments