Skip to content

Commit

Permalink
Update clap
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulstrackx committed Feb 19, 2024
1 parent 18c1a4d commit 0d83969
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion enclave-runner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ edition = "2018"

[dependencies]
aesm-client = { version = "0.5", features = ["sgxs"] }
clap = "2.0"
clap = "4.4"
enclave-runner = "0.6"
sgxs-loaders = "0.3.0"
16 changes: 8 additions & 8 deletions enclave-runner/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use aesm_client::AesmClient;
use clap::{App, Arg};
use clap::{Command, Arg, ArgAction};
use enclave_runner::EnclaveBuilder;

#[cfg(windows)]
Expand All @@ -8,20 +8,20 @@ use sgxs_loaders::enclaveapi::Sgx as IsgxDevice;
use sgxs_loaders::isgx::Device as IsgxDevice;

fn main() {
let args = App::new("runner")
.arg(Arg::with_name("file").required(true))
let args = Command::new("runner")
.arg(Arg::new("file").required(true))
.arg(
Arg::with_name("enclave-args")
.long_help(
Arg::new("enclave-args")
.help(
"Arguments passed to the enclave. \
Note that this is not an appropriate channel for passing \
secrets or security configurations to the enclave.",
)
.multiple(true),
.action(ArgAction::Append)
)
.get_matches();

let file = args.value_of("file").unwrap();
let file = args.get_one::<String>("file").unwrap();

let mut device = IsgxDevice::new()
.expect("failed to open SGX device")
Expand All @@ -33,7 +33,7 @@ fn main() {
enclave_builder.dummy_signature();
}

if let Some(enclave_args) = args.values_of("enclave-args") {
if let Some(enclave_args) = args.get_many::<String>("enclave-args") {
enclave_builder.args(enclave_args);
}

Expand Down

0 comments on commit 0d83969

Please sign in to comment.