(arguments: I)
| 5 | use crate::executable_name; |
| 6 | |
| 7 | pub fn parse_arg_matches<'a, I, T>(arguments: I) -> ArgMatches<'a> |
| 8 | where |
| 9 | I: IntoIterator<Item = T>, |
| 10 | T: Into<OsString> + Clone, |
| 11 | { |
| 12 | let init_subcommand = SubCommand::with_name("init") |
| 13 | .about("Initialize the current branch to a chain.") |
| 14 | .arg( |
| 15 | Arg::with_name("before") |
| 16 | .short("b") |
| 17 | .long("before") |
| 18 | .value_name("branch_name") |
| 19 | .help("Sort current branch before another branch.") |
| 20 | .conflicts_with("after") |
| 21 | .conflicts_with("first") |
| 22 | .takes_value(true), |
| 23 | ) |
| 24 | .arg( |
| 25 | Arg::with_name("after") |
| 26 | .short("a") |
| 27 | .long("after") |
| 28 | .value_name("branch_name") |
| 29 | .help("Sort current branch after another branch.") |
| 30 | .conflicts_with("before") |
| 31 | .conflicts_with("first") |
| 32 | .takes_value(true), |
| 33 | ) |
| 34 | .arg( |
| 35 | Arg::with_name("first") |
| 36 | .short("f") |
| 37 | .long("first") |
| 38 | .help("Sort current branch as the first branch of the chain.") |
| 39 | .conflicts_with("before") |
| 40 | .conflicts_with("after") |
| 41 | .takes_value(false), |
| 42 | ) |
| 43 | .arg( |
| 44 | Arg::with_name("chain_name") |
| 45 | .help("The name of the chain.") |
| 46 | .required(true) |
| 47 | .index(1), |
| 48 | ) |
| 49 | .arg( |
| 50 | Arg::with_name("root_branch") |
| 51 | .help("The root branch which the chain of branches will merge into.") |
| 52 | .required(false) |
| 53 | .index(2), |
| 54 | ); |
| 55 | |
| 56 | let remove_subcommand = SubCommand::with_name("remove") |
| 57 | .about("Remove current branch from its chain.") |
| 58 | .arg( |
| 59 | Arg::with_name("chain_name") |
| 60 | .short("c") |
| 61 | .long("chain") |
| 62 | .value_name("chain_name") |
| 63 | .help("Delete chain by removing all of its branches.") |
| 64 | .takes_value(true), |
no test coverage detected