git_switch_branch/commands.rs
1pub enum Command {
2 Help,
3 Version,
4 Alias,
5 Remote,
6 All,
7 Invalid,
8}
9
10use Command::*;
11
12impl Command {
13 pub fn from(arg: &str) -> Command {
14 match arg {
15 "help" | "--help" | "-h" => Help,
16 "version" | "--version" | "-v" => Version,
17 "alias" => Alias,
18 "remote" | "r" => Remote,
19 "all" | "a" => All,
20 _ => Invalid,
21 }
22 }
23}