Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
evilsocket committed Oct 28, 2024
1 parent 3b2e374 commit a947f04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/cli/inspect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ use crate::core::FileType;
use super::InspectArgs;

pub(crate) fn inspect(args: InspectArgs) -> anyhow::Result<()> {
let quiet = args.quiet.unwrap_or(false);
if !quiet {
if !args.quiet {
println!(
"Inspecting {:?} (detail={:?}{}):\n",
args.file_path,
Expand All @@ -31,7 +30,7 @@ pub(crate) fn inspect(args: InspectArgs) -> anyhow::Result<()> {
anyhow::bail!("unsupported file format")
};

if !quiet {
if !args.quiet {
println!("file type: {}", inspection.file_type);
println!("version: {}", inspection.version);
println!(
Expand Down Expand Up @@ -110,7 +109,7 @@ pub(crate) fn inspect(args: InspectArgs) -> anyhow::Result<()> {
let json_str = serde_json::to_string_pretty(&inspection)?;
std::fs::write(json_file_path, json_str)?;

if !quiet {
if !args.quiet {
println!("\nsaved to {:?}", json_file_path);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub(crate) struct InspectArgs {
filter: Option<String>,
/// Suppress inspection output.
#[clap(long, short = 'Q')]
quiet: Option<bool>,
quiet: bool,
/// Save as JSON to the specified file.
#[clap(long, short = 'J')]
to_json: Option<PathBuf>,
Expand Down

0 comments on commit a947f04

Please sign in to comment.