Open alexcrichton opened 10 years ago
#![feature(phase)] #[phase(plugin, link)] extern crate hammer; extern crate serialize; use std::os; use serialize::Decodable; #[deriving(Encodable, Decodable)] struct Foo { long: uint, } hammer_config!(Foo "test", |c| { c.short("long", 'l') }) fn main() { let mut d = hammer::FlagDecoder::new::<Foo>(os::args().as_slice()); let a: Foo = Decodable::decode(&mut d).unwrap(); }
$ ./foo -l3 task '<main>' failed at 'index out of bounds: the len is 2 but the index is 2', src/hammer.rs:1
Thanks! I'll get this tomorrow :smile: