Add help messages

This commit is contained in:
Charlie Marsh 2022-08-27 18:16:09 -04:00
parent 8b1c4fce6b
commit 6129d5bbba
2 changed files with 7 additions and 2 deletions

View File

@ -4,7 +4,7 @@ use std::sync::mpsc::channel;
use std::time::Instant;
use anyhow::Result;
use clap::Parser;
use clap::{Parser, ValueHint};
use colored::Colorize;
use log::{debug, error};
use notify::{raw_watcher, RecursiveMode, Watcher};
@ -24,14 +24,19 @@ use rust_python_linter::settings::Settings;
struct Cli {
#[clap(parse(from_os_str), value_hint = ValueHint::AnyPath, required = true)]
files: Vec<PathBuf>,
/// Enable verbose logging.
#[clap(short, long, action)]
verbose: bool,
/// Disable all logging (but still exit with status code "1" upon detecting errors).
#[clap(short, long, action)]
quiet: bool,
/// Exit with status code "0", even upon detecting errors.
#[clap(short, long, action)]
exit_zero: bool,
/// Run in watch mode by re-running whenever files change.
#[clap(short, long, action)]
watch: bool,
/// Disable cache reads.
#[clap(short, long, action)]
no_cache: bool,
}

View File

@ -61,7 +61,7 @@ impl From<bool> for Mode {
fn from(value: bool) -> Self {
match value {
true => Mode::ReadWrite,
false => Mode::None,
false => Mode::WriteOnly,
}
}
}