diff --git a/src/getopt.rs b/src/getopt.rs index c4f88ab..b146400 100644 --- a/src/getopt.rs +++ b/src/getopt.rs @@ -21,7 +21,6 @@ use std::ffi::{ c_int, c_char, CString, CStr }; pub struct Opt { pub arg: Option, pub ind: i32, - /* opt is set to either the current option or the one that cause an error */ pub opt: String, } @@ -51,8 +50,8 @@ impl GetOpt for Vec { let opts = CString::new(optstring).unwrap().into_raw(); let len = self.len() as c_int; - unsafe { - match getopt(len, argv_ptr, opts) { + unsafe { // TODO: enable optind modification + match getopt(len, argv_ptr, opts) { /* From getopt(3p): * * The getopt() function shall return the next option character @@ -95,9 +94,9 @@ impl GetOpt for Vec { .into_owned(); Some(Ok(Opt { - arg: Some(arg), - ind: optind, - opt: opt.to_string(), + arg: Some(arg), /* opt argument */ + ind: optind, /* opt index */ + opt: opt.to_string(), /* option itself */ })) }, }