+22
-6
src/main.rs
+22
-6
src/main.rs
···
40
40
// 0 args (std env args includes this script)
41
41
1 => {}
42
42
2 => {
43
-
shell = Some(std::env::args().last().expect("Invalid state: 2 `Some` std::env::args() but found no Some values"))
43
+
shell = Some(
44
+
std::env::args()
45
+
.last()
46
+
.expect("Invalid state: 2 `Some` std::env::args() but found no Some values"),
47
+
)
44
48
}
45
49
3 => {
46
50
// load args and consume first
···
63
67
repo_name = Some(val)
64
68
};
65
69
}
66
-
shell = Some(args.next().expect("Invalid state: 3 `Some` std::env::args() but only found 2"));
70
+
shell = Some(
71
+
args.next()
72
+
.expect("Invalid state: 3 `Some` std::env::args() but only found 2"),
73
+
);
67
74
}
68
-
4 => {
75
+
4 => {
69
76
// load args and consume first
70
77
let mut args = std::env::args();
71
78
args.next();
72
79
73
-
handle = Some(args.next().expect("Invalid state: 4 `Some` std::env::args() but only found 1"));
74
-
repo_name = Some(args.next().expect("Invalid state: 4 `Some` std::env::args() but only found 2"));
75
-
shell = Some(args.next().expect("Invalid state: 4 `Some` std::env::args() but only found 3"));
80
+
handle = Some(
81
+
args.next()
82
+
.expect("Invalid state: 4 `Some` std::env::args() but only found 1"),
83
+
);
84
+
repo_name = Some(
85
+
args.next()
86
+
.expect("Invalid state: 4 `Some` std::env::args() but only found 2"),
87
+
);
88
+
shell = Some(
89
+
args.next()
90
+
.expect("Invalid state: 4 `Some` std::env::args() but only found 3"),
91
+
);
76
92
}
77
93
_ => {
78
94
// err