From c007a2cbf8389421aee25633285e43d58a5b2122 Mon Sep 17 00:00:00 2001 From: Wilson Lin Date: Sat, 7 Aug 2021 19:10:47 +1000 Subject: [PATCH] Update CLI --- cli/src/main.rs | 83 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 54 insertions(+), 29 deletions(-) diff --git a/cli/src/main.rs b/cli/src/main.rs index a9d18b5..0472787 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -1,12 +1,16 @@ use std::fs::File; -use std::io::{Read, stdin, stdout, Write}; +use std::io::{stdin, stdout, Read, Write}; use structopt::StructOpt; -use minify_html::{Cfg, FriendlyError, with_friendly_error}; +use minify_html::{minify, Cfg}; #[derive(StructOpt)] -#[structopt(name = "minify-html", about = "Extremely fast and smart HTML + JS + CSS minifier")] +#[structopt( + name = "minify-html", + about = "Extremely fast and smart HTML + JS + CSS minifier" +)] +// WARNING: Keep descriptions in sync with Cfg. struct Cli { /// File to minify; omit for stdin. #[structopt(short, long, parse(from_os_str))] @@ -14,12 +18,30 @@ struct Cli { /// Output destination; omit for stdout. #[structopt(short, long, parse(from_os_str))] out: Option, - /// Enables JS minification. + /// Minify JS in `