(args: &[String])
| 714 | } |
| 715 | |
| 716 | pub(crate) fn command_tokens(args: &[String]) -> Vec<String> { |
| 717 | let mut tokens = Vec::new(); |
| 718 | let mut index = 0; |
| 719 | while let Some(arg) = args.get(index) { |
| 720 | if arg.starts_with('-') { |
| 721 | if option_takes_value(arg) && !arg.contains('=') { |
| 722 | index += 2; |
| 723 | } else { |
| 724 | index += 1; |
| 725 | } |
| 726 | continue; |
| 727 | } |
| 728 | tokens.push(arg.clone()); |
| 729 | index += 1; |
| 730 | } |
| 731 | tokens |
| 732 | } |
| 733 | |
| 734 | fn option_takes_value(arg: &str) -> bool { |
| 735 | matches!( |
no test coverage detected