Skip to content

Commit

Permalink
feat: Rename expand to inspect
Browse files Browse the repository at this point in the history
  • Loading branch information
blelump committed Dec 4, 2024
1 parent d945c6c commit 4fe32fa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/expand.rs → src/inspect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ fn readable_nontrans_receipt(pair: (PublicKey, Signature)) -> String {
)
}

pub fn expand(cesr: &str) {
pub fn inspect(cesr: &str) {
let no_whitespace = cesr
.chars()
.filter(|c| !c.is_whitespace())
Expand Down Expand Up @@ -160,11 +160,11 @@ pub fn expand(cesr: &str) {
}

#[test]
fn test_expand() {
fn test_inspect() {
let cesr_with_whitespaces = r#"{"hello":"world"}-FABEECGIp5CTCJZlZg-kap5Ma04x_tP_xWG90oKRPTW0Geq0AAAAAAAAAAAA AAAAAAAAAAAEECGIp5CTCJZlZg-kap5Ma04x_tP_xWG90oKRPTW0Geq-AABAAArmG_maHPKlUvMXkJfEysM_ej84lWdbtJXYWlrOBkhM1td1idMU0wUIBm5XkaRIw78QmFHUrYoi_kkryhJJy8J-CABBDg3H7Sr-eES0XWXiO8nvMxW6mD_1LxLeE1nuiZxhGp40BBFHf56jD6v15vWezesWY-RPj2ZiXGC-834wAp5TqeW-6VehAMvyAi9ojCfDr1OSYlAWTpEPY6SPfKFFKGUnbQJ"#;
expand(&cesr_with_whitespaces);
inspect(&cesr_with_whitespaces);

let cesr_stream = r#"{"hello":"world"}-FABEECGIp5CTCJZlZg-kap5Ma04x_tP_xWG90oKRPTW0Geq0AAAAAAAAAAAAAAAAAAAAAAAEECGIp5CTCJZlZg-kap5Ma04x_tP_xWG90oKRPTW0Geq-AABAAArmG_maHPKlUvMXkJfEysM_ej84lWdbtJXYWlrOBkhM1td1idMU0wUIBm5XkaRIw78QmFHUrYoi_kkryhJJy8J-CABBDg3H7Sr-eES0XWXiO8nvMxW6mD_1LxLeE1nuiZxhGp40BBFHf56jD6v15vWezesWY-RPj2ZiXGC-834wAp5TqeW-6VehAMvyAi9ojCfDr1OSYlAWTpEPY6SPfKFFKGUnbQJ"#;
// let cesr_stream = r#"{"v":"KERI10JSON000159_","t":"icp","d":"EECGIp5CTCJZlZg-kap5Ma04x_tP_xWG90oKRPTW0Geq","i":"EECGIp5CTCJZlZg-kap5Ma04x_tP_xWG90oKRPTW0Geq","s":"0","kt":"1","k":["DI4mF-VUtO2lWrSgGxuslV0UDSNo_5UlcBScEQ-lhqQp"],"nt":"1","n":["EBQu8B_UuT_My1ZtYY-a4AK7cWAFSAfb3iuWPquch5lA"],"bt":"1","b":["BDg3H7Sr-eES0XWXiO8nvMxW6mD_1LxLeE1nuiZxhGp4"],"c":[],"a":[]}-AABAAB2N9iNgROzLn-ikiyzQb1S2o04H7YnjlAVobikfEF_z9hg5-gK1yW-i1mUiqE3sktW-WhzrTUEyDS36Q_0qlQL{"v":"KERI10JSON000091_","t":"rct","d":"EECGIp5CTCJZlZg-kap5Ma04x_tP_xWG90oKRPTW0Geq","i":"EECGIp5CTCJZlZg-kap5Ma04x_tP_xWG90oKRPTW0Geq","s":"0"}-CABBDg3H7Sr-eES0XWXiO8nvMxW6mD_1LxLeE1nuiZxhGp40BBFHf56jD6v15vWezesWY-RPj2ZiXGC-834wAp5TqeW-6VehAMvyAi9ojCfDr1OSYlAWTpEPY6SPfKFFKGUnbQJ"#;
expand(&cesr_stream);
inspect(&cesr_stream);
}
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ use subcommands::{
use utils::working_directory;

mod error;
mod expand;
mod export;
mod help;
mod init;
mod inspect;
mod kel;
mod keri;
mod mesagkesto;
Expand Down
10 changes: 5 additions & 5 deletions src/subcommands/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use clap::Subcommand;
use std::io::{self, IsTerminal, Read};

use crate::{
expand,
inspect,
sign::handle_sign,
tel::handle_issue,
verification_status::VerificationStatus,
Expand Down Expand Up @@ -31,7 +31,7 @@ pub enum DataCommand {
message: Option<String>,
},
/// Presents CESR data in a human-readable format
Expand {
Inspect {
/// JSON-based data with CESR attachments to be transformed into a readable format
#[arg(short, long)]
message: Option<String>,
Expand Down Expand Up @@ -114,8 +114,8 @@ pub async fn process_data_command(command: DataCommand) -> Result<(), CliError>
}
}
}
DataCommand::Expand { message } => match message {
Some(message) => expand::expand(&message),
DataCommand::Inspect { message } => match message {
Some(message) => inspect::inspect(&message),
None => {
if io::stdin().is_terminal() {
return Err(CliError::OptionOrStdinError("-m".to_string()));
Expand All @@ -127,7 +127,7 @@ pub async fn process_data_command(command: DataCommand) -> Result<(), CliError>
description: format!("Failed to read from stdin: {}", e),
})
})?;
expand::expand(&buffer)
inspect::inspect(&buffer)
}
},
DataCommand::Issue {
Expand Down

0 comments on commit 4fe32fa

Please sign in to comment.