Skip to content

Commit

Permalink
Merge pull request #33 from slp/fix-multiple-args
Browse files Browse the repository at this point in the history
Restrict the number of values of "-p" and "-v"
  • Loading branch information
slp authored Aug 16, 2022
2 parents ba9e585 + f9f4d4f commit e67d0ea
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "krunvm"
version = "0.2.1"
version = "0.2.2"
authors = ["Sergio Lopez <[email protected]>"]
description = "Create microVMs from OCI images"
repository = "https://github.com/containers/krunvm"
Expand Down
12 changes: 8 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ fn main() {
.short("v")
.help("Volume in form \"host_path:guest_path\" to be exposed to the guest")
.takes_value(true)
.multiple(true),
.multiple(true)
.number_of_values(1),
)
.arg(
Arg::with_name("remove-ports")
Expand All @@ -208,7 +209,8 @@ fn main() {
.short("p")
.help("Port in format \"host_port:guest_port\" to be exposed to the host")
.takes_value(true)
.multiple(true),
.multiple(true)
.number_of_values(1),
)
.arg(
Arg::with_name("new-name")
Expand Down Expand Up @@ -279,15 +281,17 @@ fn main() {
.short("v")
.help("Volume in form \"host_path:guest_path\" to be exposed to the guest")
.takes_value(true)
.multiple(true),
.multiple(true)
.number_of_values(1),
)
.arg(
Arg::with_name("port")
.long("port")
.short("p")
.help("Port in format \"host_port:guest_port\" to be exposed to the host")
.takes_value(true)
.multiple(true),
.multiple(true)
.number_of_values(1),
)
.arg(
Arg::with_name("name")
Expand Down

0 comments on commit e67d0ea

Please sign in to comment.