diff --git a/CHANGELOG.md b/CHANGELOG.md index 05fb35e..219dcc0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## 1.1.0 - Added -bom check flag to fix/work around issues where the BOM causes files to fail. -- Added the -v/--verbose flag to print out all the files touched. +- Added the --verbose flag to print out all the files touched. - Enabled arbitrary_precision in serde_json to keep large numbers intact when changing file. ## 1.0.0 diff --git a/Cargo.lock b/Cargo.lock index 98dacf3..c47e274 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -80,7 +80,7 @@ dependencies = [ [[package]] name = "pitufo" -version = "2.0.0" +version = "1.1.0" dependencies = [ "argh", "pretty_assertions", diff --git a/README.md b/README.md index a8081cc..b6f1ae3 100644 --- a/README.md +++ b/README.md @@ -25,17 +25,18 @@ cargo install pitufo ## Usage ```console -Usage: pitufo [--follow] [--minify] [--bom] [-m ] -p - -usage of pitufo +Usage: pitufo [--follow] [--verbose] [--minify] [--bom] [-m ] -p Options: --follow follow symbolic links, the default is to not follow. + --verbose verbose mode, output the path of every file found, defaults + to silent --minify minify the json, the default is to prettify. --bom look for leading BOM in json files and remove if found, the default is to take the file as-is. -m, --max-depth set the maximum depth to recurse - -p, --path the path to search for json fi + -p, --path the path to search for json files. + --help display usage information ``` ## Example diff --git a/src/main.rs b/src/main.rs index f32aad1..660b0fd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,6 +10,11 @@ pub struct Opts { #[argh(switch, long = "follow")] follow_links: bool, + /// verbose mode, output the path of every file found, + /// defaults to silent + #[argh(switch)] + verbose: bool, + /// minify the json, the default is to prettify. #[argh(switch)] minify: bool, @@ -45,6 +50,8 @@ fn main() { { if let Err(e) = process_file(&entry, options.minify, options.bom) { eprintln!("error {} {}", e, entry.path().display()); + } else if options.verbose { + println!("{}", entry.path().display()); } } }