Function iter_short

Source
pub fn iter_short<'a, T>(arg: &'a T) -> Option<ShortIter<'a>>
where T: AsRef<OsStr> + ?Sized,
Expand description

Creates an iterator of short arguments if the input is in the form -abc.

This is a helper for parsing short arguments in the same way many GNU commands support. It enables putting several flags into a single argument and enables the last one to be a short parameter with a value and the value might be either concatenated or put as the next argument.

In order to use this, one would call this function and, if it returned Some(iter), then iterate iter and match returned chars. If a char representing a parameter with value is returned from next, .parse_remaining() method should be called on the iterator. It will attempt to parse the value from remaining part, if present. If there’s none, it’ll attempt to parse it from the following argument pulled from the parameter.

This is how configure_me uses this feature, but you can use it without configure_me.