pub fn parse_options(argv: &[String]) -> Vec<String> {
    let mut options: Vec<String> = Vec::new();
    for arg in argv {
        if arg.starts_with('-') {
            // test to confirm that this is not a single hyphen argument
            // Per POSIX guidelines, the single hyphen is used to represent
            // stdin/stdout and should not be parsed as an option
            if arg == "-" {
                continue;
            }
            // test to confirm that we haven't encountered a double
            // hyphen command line argument
            // Per POSIX guidelines, the double hyphen indicates that all
            // subsequent argument parsing for options should be ignored
            if is_double_hyphen_option(&arg[..]) {
                break;
            }
            // test for a definition formatted option (e.g., `--option=definition`)
            // parse to option and definition parts if identified
            if is_definition_option(&arg[..]) {
                let option_definition_vec = get_definition_parts(&arg[..]);
                let option = &option_definition_vec[0];
                options.push(option.to_string());
            } else {
                options.push(arg.clone());
            }
        }
    }

    options
}
/// Returns `Vec<String>` of command line option arguments in a command line string.
Returns `Vec` of command line option arguments in a command line string.
Returns ` Vec ` of command line option arguments in a command line string .
pub fn parse_options(argv: &[String]) -> Vec<String> {
    let mut options: Vec<String> = Vec::new();
    for arg in argv {
        if arg.starts_with('-') {
            // test to confirm that this is not a single hyphen argument
            // Per POSIX guidelines, the single hyphen is used to represent
            // stdin/stdout and should not be parsed as an option
            if arg == "-" {
                continue;
            }
            // test to confirm that we haven't encountered a double
            // hyphen command line argument
            // Per POSIX guidelines, the double hyphen indicates that all
            // subsequent argument parsing for options should be ignored
            if is_double_hyphen_option(&arg[..]) {
                break;
            }
            // test for a definition formatted option (e.g., `--option=definition`)
            // parse to option and definition parts if identified
            if is_definition_option(&arg[..]) {
                let option_definition_vec = get_definition_parts(&arg[..]);
                let option = &option_definition_vec[0];
                options.push(option.to_string());
            } else {
                options.push(arg.clone());
            }
        }
    }
    options
}
pub fn parse_options ( argv : & [ String ] ) -> Vec < String > { let mut options : Vec < String > = Vec :: new ( ) ; for arg in argv { if arg . starts_with ( '-' ) { // test to confirm that this is not a single hyphen argument // Per POSIX guidelines, the single hyphen is used to represent // stdin/stdout and should not be parsed as an option if arg == " " { continue ; } // test to confirm that we haven't encountered a double // hyphen command line argument // Per POSIX guidelines, the double hyphen indicates that all // subsequent argument parsing for options should be ignored if is_double_hyphen_option ( & arg [ .. ] ) { break ; } // test for a definition formatted option (e.g., `--option=definition`) // parse to option and definition parts if identified if is_definition_option ( & arg [ .. ] ) { let option_definition_vec = get_definition_parts ( & arg [ .. ] ) ; let option = & option_definition_vec [ 0 ] ; options . push ( option . to_string ( ) ) ; } else { options . push ( arg . clone ( ) ) ; } } } options }
Returns `Vec<String>` of command line option arguments in a command line string.
Returns ` Vec<String > ` of command line option arguments in a command line string .
argv
&[String]
argv
&[String]