Skip to content

Commit

Permalink
before v0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dandyvica committed Dec 28, 2024
1 parent c0d92f7 commit 52f5e2d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::transport::{endpoint::EndPoint, TransportOptions};

// value of the environment variable for flags if any
const ENV_FLAGS: &str = "DQY_FLAGS";
const VERSION: &str = "0.4.0";
const VERSION: &str = "v0.4.0";

// help to set or unset flags
macro_rules! set_unset_flag {
Expand Down Expand Up @@ -554,6 +554,7 @@ Caveat: all options starting with a dash (-) should be placed after optional [TY
.arg(
Arg::new("tpl")
.long("tpl")
.hide(true)
.long_help("Name of the handlebars template to render to display results.")
.action(ArgAction::Set)
.value_name("TEMPLATE")
Expand Down
2 changes: 1 addition & 1 deletion src/dns/rfc/resource_record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ impl ResourceRecord {
// convert domain name back to UTF-8
if self.name.is_puny() {
let unicode = self.name.to_unicode().unwrap();
print!("{}\t\t\t", unicode.bright_green());
print!("{:<name_length$}", unicode.bright_green());
}
// not puny-like
else {
Expand Down
17 changes: 9 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@

// TODO:
// hide --tpl for the moment
// colors in clap ?
// analyze --align if necessary
// --show-opt ?
// fix display options

//! A DNS resource query tool
use std::{process::ExitCode, time::Instant};

Expand Down Expand Up @@ -99,13 +107,6 @@ pub fn get_messages(info: Option<&mut QueryInfo>, options: &CliOptions) -> error

rt.block_on(async {
let messages = DnsProtocol::quic_process_request(options, BUFFER_SIZE).await?;
// transport.handle.0.finish().await.unwrap();

// we want run info
// if let Some(info) = info {
// info.netinfo = *transport.network_info();
// }

Ok(messages)
})
}
Expand Down Expand Up @@ -183,7 +184,7 @@ fn run() -> error::Result<()> {
// print out final results
//───────────────────────────────────────────────────────────────────────────────────
if let Some(tpl) = &options.display.hb_tpl {
handlebars::render(&messages, &info, &tpl);
handlebars::render(&messages, &info, tpl);
} else {
messages.show_all(&options.display, info);
}
Expand Down

0 comments on commit 52f5e2d

Please sign in to comment.