commit 8ce06311555e60b59e21b1ede64f5d92f160fc7e Author: Nathan Vegdahl Date: Fri Dec 12 23:33:13 2014 -0800 Getting dependencies and such setup properly. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b56d5ef --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/target +/Cargo.lock +.zedstate diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..0f411e2 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,15 @@ +[package] + +name = "Led" +version = "0.0.1" +authors = ["Nathan Vegdahl "] + +[[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" \ No newline at end of file diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..092e623 --- /dev/null +++ b/src/main.rs @@ -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 + 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); +} \ No newline at end of file