forked from bonsai/harakit
fop(1): updated to latest optind api
This commit is contained in:
parent
e862b7fec6
commit
02daca87dc
@ -44,13 +44,13 @@ fn main() {
|
|||||||
Ok(o) => {
|
Ok(o) => {
|
||||||
/* unwrap because Err(OptError::MissingArg) will be returned if
|
/* unwrap because Err(OptError::MissingArg) will be returned if
|
||||||
* o.arg is None */
|
* o.arg is None */
|
||||||
let arg = o.arg.unwrap();
|
let arg = o.arg.clone().unwrap();
|
||||||
let arg_char = arg.chars().collect::<Vec<char>>();
|
let arg_char = arg.chars().collect::<Vec<char>>();
|
||||||
if arg_char.len() > 1 {
|
if arg_char.len() > 1 {
|
||||||
eprintln!("{}: {}: Not a character.", argv[0], arg);
|
eprintln!("{}: {}: Not a character.", argv[0], arg);
|
||||||
exit(EX_USAGE);
|
exit(EX_USAGE);
|
||||||
} else { d = arg_char[0]; }
|
} else { d = arg_char[0]; }
|
||||||
unsafe { index_arg = *o.ind as usize; }
|
index_arg = o.index();
|
||||||
},
|
},
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
eprintln!("{}", usage);
|
eprintln!("{}", usage);
|
||||||
|
Loading…
Reference in New Issue
Block a user