fop(1): updated to latest optind api

This commit is contained in:
Emma Tebibyte 2024-06-05 11:55:16 -06:00
parent e862b7fec6
commit 02daca87dc
Signed by untrusted user: emma
GPG Key ID: 06FA419A1698C270

View File

@ -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);