#[macro_use]
extern crate structopt;
use structopt::StructOpt;
mod args {
#[derive(Debug, StructOpt)]
#[structopt(bin_name = "cargo")]
pub enum Command {
#[structopt(name = "diet")]
#[structopt(
after_help = "This command allows you to add an include directive to minimize the package size of your crate."
)]
Diet(Args),
}
#[derive(Debug, StructOpt)]
pub struct Args {
#[structopt(long, short = "r")]
pub reset_manifest: bool,
#[structopt(long, short = "n")]
pub dry_run: bool,
}
}
use args::{Args, Command};
fn main() -> anyhow::Result<()> {
let Command::Diet(Args {
reset_manifest: reset,
dry_run,
}) = Command::from_args();
cargo_diet::execute(
cargo_diet::Options {
reset,
dry_run,
colored_output: atty::is(atty::Stream::Stdout),
},
std::io::stdout().lock(),
)?;
Ok(())
}