feat: updates
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use std::collections::BTreeMap;
|
||||
use crate::{cmdutil, seutil};
|
||||
use crate::{cmdutil, seutil, util};
|
||||
use clap::{App, ArgMatches, SubCommand};
|
||||
use rust_util::util_clap::{Command, CommandError};
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
pub struct CommandImpl;
|
||||
|
||||
@@ -11,8 +11,9 @@ impl Command for CommandImpl {
|
||||
}
|
||||
|
||||
fn subcommand<'a>(&self) -> App<'a, 'a> {
|
||||
SubCommand::with_name(self.name()).about("Secure Enclave subcommand")
|
||||
.arg(cmdutil::build_json_arg())
|
||||
SubCommand::with_name(self.name())
|
||||
.about("Secure Enclave subcommand")
|
||||
.arg(cmdutil::build_json_arg())
|
||||
}
|
||||
|
||||
fn run(&self, _arg_matches: &ArgMatches, sub_arg_matches: &ArgMatches) -> CommandError {
|
||||
@@ -22,15 +23,14 @@ impl Command for CommandImpl {
|
||||
|
||||
if json_output {
|
||||
json.insert("se_supported", seutil::is_support_se());
|
||||
} else {
|
||||
if seutil::is_support_se() {
|
||||
success!("Secure Enclave is supported.")
|
||||
} else {
|
||||
failure!("Secure Enclave is NOT supported.")
|
||||
}
|
||||
}
|
||||
|
||||
if json_output {}
|
||||
util::print_pretty_json(&json);
|
||||
} else {
|
||||
success!(
|
||||
"Secure Enclave is {}supported.",
|
||||
iff!(seutil::is_support_se(), "", "NOT ")
|
||||
);
|
||||
}
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user