mirror of https://github.com/astral-sh/ruff
Add help messages
This commit is contained in:
parent
8b1c4fce6b
commit
6129d5bbba
|
|
@ -4,7 +4,7 @@ use std::sync::mpsc::channel;
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use clap::Parser;
|
use clap::{Parser, ValueHint};
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
use log::{debug, error};
|
use log::{debug, error};
|
||||||
use notify::{raw_watcher, RecursiveMode, Watcher};
|
use notify::{raw_watcher, RecursiveMode, Watcher};
|
||||||
|
|
@ -24,14 +24,19 @@ use rust_python_linter::settings::Settings;
|
||||||
struct Cli {
|
struct Cli {
|
||||||
#[clap(parse(from_os_str), value_hint = ValueHint::AnyPath, required = true)]
|
#[clap(parse(from_os_str), value_hint = ValueHint::AnyPath, required = true)]
|
||||||
files: Vec<PathBuf>,
|
files: Vec<PathBuf>,
|
||||||
|
/// Enable verbose logging.
|
||||||
#[clap(short, long, action)]
|
#[clap(short, long, action)]
|
||||||
verbose: bool,
|
verbose: bool,
|
||||||
|
/// Disable all logging (but still exit with status code "1" upon detecting errors).
|
||||||
#[clap(short, long, action)]
|
#[clap(short, long, action)]
|
||||||
quiet: bool,
|
quiet: bool,
|
||||||
|
/// Exit with status code "0", even upon detecting errors.
|
||||||
#[clap(short, long, action)]
|
#[clap(short, long, action)]
|
||||||
exit_zero: bool,
|
exit_zero: bool,
|
||||||
|
/// Run in watch mode by re-running whenever files change.
|
||||||
#[clap(short, long, action)]
|
#[clap(short, long, action)]
|
||||||
watch: bool,
|
watch: bool,
|
||||||
|
/// Disable cache reads.
|
||||||
#[clap(short, long, action)]
|
#[clap(short, long, action)]
|
||||||
no_cache: bool,
|
no_cache: bool,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ impl From<bool> for Mode {
|
||||||
fn from(value: bool) -> Self {
|
fn from(value: bool) -> Self {
|
||||||
match value {
|
match value {
|
||||||
true => Mode::ReadWrite,
|
true => Mode::ReadWrite,
|
||||||
false => Mode::None,
|
false => Mode::WriteOnly,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue