feat: v0.4.2, add --direct-print
This commit is contained in:
@@ -12,7 +12,7 @@ pub fn format_envelop(envelop: &TinyEncryptEnvelop, config: &Option<TinyEncryptC
|
||||
let desc = envelop_desc.as_ref()
|
||||
.map(|desc| format!(", Desc: {}", desc))
|
||||
.unwrap_or_else(|| "".to_string());
|
||||
format!("{}{}{}", with_with(&envelop.r#type.get_upper_name(), 10), envelop_kid, desc)
|
||||
format!("{}{}{}", with_width_type(&envelop.r#type.get_upper_name()), envelop_kid, desc)
|
||||
}
|
||||
|
||||
fn get_envelop_desc(envelop: &TinyEncryptEnvelop, config_envelop: &Option<&TinyEncryptConfigEnvelop>) -> Option<String> {
|
||||
@@ -25,6 +25,10 @@ fn get_envelop_desc(envelop: &TinyEncryptEnvelop, config_envelop: &Option<&TinyE
|
||||
None
|
||||
}
|
||||
|
||||
fn with_with(s: &str, width: usize) -> String {
|
||||
pub fn with_width_type(s: &str) -> String {
|
||||
with_width(s, 10)
|
||||
}
|
||||
|
||||
pub fn with_width(s: &str, width: usize) -> String {
|
||||
iff!(s.len() < width, format!("{}{}", s, " ".repeat(width - s.len())), s.to_string())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user