Skip to content

Commit e67d0ea

Browse files
authored
Merge pull request #33 from slp/fix-multiple-args
Restrict the number of values of "-p" and "-v"
2 parents ba9e585 + f9f4d4f commit e67d0ea

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "krunvm"
3-
version = "0.2.1"
3+
version = "0.2.2"
44
authors = ["Sergio Lopez <[email protected]>"]
55
description = "Create microVMs from OCI images"
66
repository = "https://github.com/containers/krunvm"

src/main.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ fn main() {
195195
.short("v")
196196
.help("Volume in form \"host_path:guest_path\" to be exposed to the guest")
197197
.takes_value(true)
198-
.multiple(true),
198+
.multiple(true)
199+
.number_of_values(1),
199200
)
200201
.arg(
201202
Arg::with_name("remove-ports")
@@ -208,7 +209,8 @@ fn main() {
208209
.short("p")
209210
.help("Port in format \"host_port:guest_port\" to be exposed to the host")
210211
.takes_value(true)
211-
.multiple(true),
212+
.multiple(true)
213+
.number_of_values(1),
212214
)
213215
.arg(
214216
Arg::with_name("new-name")
@@ -279,15 +281,17 @@ fn main() {
279281
.short("v")
280282
.help("Volume in form \"host_path:guest_path\" to be exposed to the guest")
281283
.takes_value(true)
282-
.multiple(true),
284+
.multiple(true)
285+
.number_of_values(1),
283286
)
284287
.arg(
285288
Arg::with_name("port")
286289
.long("port")
287290
.short("p")
288291
.help("Port in format \"host_port:guest_port\" to be exposed to the host")
289292
.takes_value(true)
290-
.multiple(true),
293+
.multiple(true)
294+
.number_of_values(1),
291295
)
292296
.arg(
293297
Arg::with_name("name")

0 commit comments

Comments
 (0)