README.md
This commit is contained in:
parent
b668a894c7
commit
1f2c3bf9c2
3 changed files with 57 additions and 8 deletions
19
src/main.rs
19
src/main.rs
|
|
@ -50,6 +50,12 @@ impl ValueEnum for Theme {
|
|||
}
|
||||
}
|
||||
|
||||
macro_rules! types_crates {
|
||||
() => {
|
||||
"rustc_hir_typeck,rustc_infer,rustc_next_trait_solver,rustc_middle,rustc_traits,rustc_trait_selection,rustc_type_ir,rustc_ty_utils"
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Subcommand, Debug)]
|
||||
enum Preset {
|
||||
/// Explore logs
|
||||
|
|
@ -64,10 +70,11 @@ enum Preset {
|
|||
theme: Theme,
|
||||
},
|
||||
|
||||
/// Get all the typesystem related logs
|
||||
#[command(about = concat!("Get all the typesystem related logs: ", types_crates!()))]
|
||||
Types,
|
||||
/// Get all logs
|
||||
All,
|
||||
/// Specific, comma-separated crates to gather logs from
|
||||
Crates {
|
||||
#[arg(short, long)]
|
||||
crates: Vec<String>,
|
||||
|
|
@ -87,7 +94,7 @@ fn default_tempdir() -> PathBuf {
|
|||
}
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(version, about, long_about = None)]
|
||||
#[command(version, about, long_about)]
|
||||
struct Args {
|
||||
#[command(subcommand)]
|
||||
preset: Preset,
|
||||
|
|
@ -113,14 +120,12 @@ fn main() {
|
|||
let rustc_log = match preset {
|
||||
Preset::Show {
|
||||
compiler_root,
|
||||
theme: Theme(theme)
|
||||
}=> {
|
||||
theme: Theme(theme),
|
||||
} => {
|
||||
tui::run(logs_dir, compiler_root, theme);
|
||||
exit(0);
|
||||
}
|
||||
Preset::Types => {
|
||||
"rustc_hir_typeck,rustc_infer,rustc_next_trait_solver,rustc_middle,rustc_traits,rustc_trait_selection,rustc_type_ir,rustc_ty_utils".to_string()
|
||||
}
|
||||
Preset::Types => types_crates!().to_string(),
|
||||
Preset::All => "debug".to_string(),
|
||||
Preset::Crates { crates } => crates.join(",").to_string(),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ targeting logs:
|
|||
|
||||
either a field after `f` or the text of the current log:
|
||||
p ... with a prefix
|
||||
r ... matching a regex
|
||||
/ ... matching a regex
|
||||
e ... equal to selected
|
||||
c ... containing
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue