README.md

This commit is contained in:
Jana Dönszelmann 2026-03-31 17:36:14 +02:00
parent b668a894c7
commit 1f2c3bf9c2
No known key found for this signature in database
3 changed files with 57 additions and 8 deletions

View file

@ -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(),
};