Getting dependencies and such setup properly.

This commit is contained in:
Nathan Vegdahl 2014-12-12 23:33:13 -08:00
commit 8ce0631155
3 changed files with 49 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/target
/Cargo.lock
.zedstate

15
Cargo.toml Normal file
View File

@ -0,0 +1,15 @@
[package]
name = "Led"
version = "0.0.1"
authors = ["Nathan Vegdahl <cessen@cessen.com>"]
[[bin]]
name = "led"
path = "src/main.rs"
[dependencies.docopt]
git = "https://github.com/docopt/docopt.rs.git"
[dependencies.rustbox]
git = "https://github.com/gchp/rustbox.git"

31
src/main.rs Normal file
View File

@ -0,0 +1,31 @@
extern crate rustbox;
extern crate docopt;
extern crate serialize;
use docopt::Docopt;
// Usage documentation string
static USAGE: &'static str = "
Usage: led <file>
led --help
Options:
-h, --help Show this message
";
// Struct for storing command-line arguments
#[deriving(Decodable, Show)]
struct Args {
arg_file: String,
flag_help: bool,
}
fn main() {
// Get command-line arguments
let args: Args = Docopt::new(USAGE).and_then(|d| d.decode()).unwrap_or_else(|e| e.exit());
println!("Hello! {}", args.arg_file);
}