feat: v1.9.18
This commit is contained in:
@@ -54,6 +54,9 @@ pub struct CmdConfig {
|
||||
/// Temporary key output
|
||||
#[arg(long)]
|
||||
pub temporary_key: bool,
|
||||
/// Hide __all__
|
||||
#[arg(long)]
|
||||
pub hide_all: bool,
|
||||
/// Encryption profile (use default when --key-filter is assigned)
|
||||
#[arg(long, short = 'p')]
|
||||
pub profile: Option<String>,
|
||||
@@ -129,7 +132,7 @@ fn strip_field(kid: &str, max_len: usize) -> String {
|
||||
}
|
||||
}
|
||||
|
||||
fn config_profiles(cmd_version: &CmdConfig, config: &TinyEncryptConfig) -> XResult<()> {
|
||||
fn config_profiles(cmd_config: &CmdConfig, config: &TinyEncryptConfig) -> XResult<()> {
|
||||
let mut reverse_map = HashMap::new();
|
||||
if let Some(profiles) = &config.profiles {
|
||||
for (p, v) in profiles {
|
||||
@@ -148,6 +151,9 @@ fn config_profiles(cmd_version: &CmdConfig, config: &TinyEncryptConfig) -> XResu
|
||||
let mut ps: Vec<_> = pvs.iter().map(|pv| pv.0).collect();
|
||||
ps.sort();
|
||||
let pp = ps.iter().map(|s| s.to_string()).collect::<Vec<_>>().join(", ");
|
||||
if cmd_config.hide_all && pp == "__all__" {
|
||||
continue;
|
||||
}
|
||||
let kids = pvs[0].1;
|
||||
let mut ks = Vec::with_capacity(kids.len());
|
||||
for kid in kids {
|
||||
@@ -156,7 +162,7 @@ fn config_profiles(cmd_version: &CmdConfig, config: &TinyEncryptConfig) -> XResu
|
||||
ks.push(format!("[ERROR] Key not found: {}", kid));
|
||||
}
|
||||
Some(envelop) => {
|
||||
let kid = if cmd_version.show_kid {
|
||||
let kid = if cmd_config.show_kid {
|
||||
format!("Kid: {}", envelop.kid)
|
||||
} else {
|
||||
envelop.sid.as_ref()
|
||||
|
||||
Reference in New Issue
Block a user