tracel-xtask-cli 1.1.1

CLI entrypoint for Tracel xtask
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::ffi::OsString;

pub fn take_subrepo_selector(args: &mut Vec<OsString>) -> Option<String> {
    let first = args.first()?.clone(); // own it; no borrow into args
    let s = first.to_string_lossy();
    if s.starts_with('-') {
        return None;
    }
    let rest = s.strip_prefix(':')?;
    if rest.is_empty() {
        return None;
    }
    args.remove(0);
    Some(rest.to_string())
}