From 0d839697d70b9967beb7df2f1ed227cae822303d Mon Sep 17 00:00:00 2001 From: Raoul Strackx Date: Tue, 23 Jan 2024 13:37:46 +0100 Subject: [PATCH] Update clap --- enclave-runner/Cargo.toml | 2 +- enclave-runner/src/main.rs | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/enclave-runner/Cargo.toml b/enclave-runner/Cargo.toml index 6dffc164932..3c8e59096aa 100644 --- a/enclave-runner/Cargo.toml +++ b/enclave-runner/Cargo.toml @@ -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" diff --git a/enclave-runner/src/main.rs b/enclave-runner/src/main.rs index 6042dd0397c..788c3347408 100644 --- a/enclave-runner/src/main.rs +++ b/enclave-runner/src/main.rs @@ -1,5 +1,5 @@ use aesm_client::AesmClient; -use clap::{App, Arg}; +use clap::{Command, Arg, ArgAction}; use enclave_runner::EnclaveBuilder; #[cfg(windows)] @@ -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::("file").unwrap(); let mut device = IsgxDevice::new() .expect("failed to open SGX device") @@ -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::("enclave-args") { enclave_builder.args(enclave_args); }