Crates.io | hello_rusty_worlds |
lib.rs | hello_rusty_worlds |
version | 0.1.0 |
source | src |
created_at | 2016-01-12 04:21:47.531514 |
updated_at | 2016-01-12 04:21:47.531514 |
description | A hello world crate with automated testing, documentation, continuous integration, tested example code, implemented as a library with a command line tool. Supports Sol and all its planets, not just 'Hello (unspecified) world!' |
homepage | https://github.com/Densaugeo/hello_rusty_worlds |
repository | https://github.com/Densaugeo/hello_rusty_worlds |
max_upload_size | |
id | 3881 |
size | 22,423 |
A hello world crate with automated testing, documentation, continuous integration, tested example code, implemented as a library with a command line tool. Supports Sol and all its planets, not just 'Hello (unspecified) world!'
https://densaugeo.github.io/hello_rusty_worlds/
Add to Cargo.toml dependencies section:
[dependencies]
hello_rusty_worlds = { git = "https://github.com/Densaugeo/hello_rusty_worlds" }
Then call from your code using extern crate
:
extern crate hello_rusty_worlds;
fn main() {
println!("{}", hello_rusty_worlds::hello_world(3).unwrap()); // Prints "Hello Earth!"
}
Install the command line tool through cargo install
:
[lunariel@morpheus ~]$ cargo install --git https://github.com/Densaugeo/hello_rusty_worlds
Updating git repository `https://github.com/Densaugeo/hello_rusty_worlds`
Compiling hello_rusty_worlds v0.1.0 (https://github.com/Densaugeo/hello_rusty_worlds#b20dd5c0)
Installing /home/lunariel/.cargo/bin/hello-world
be sure to add `/home/lunariel/.cargo/bin` to your PATH to be able to run the installed binaries
As the message notes, you may need to add cargo's bin folder to your $PATH. This will enable all command line tools installed through cargo. On linux:
[lunariel@morpheus ~]$ export PATH=$PATH:/home/lunariel/.cargo/bin
The binary is installed under the name hello-world
, and takes one argument, a planet's number:
[lunariel@morpheus ~]$ hello-world 1
Hello Mercury!