From 43d5a4965308ec4b594725c0bd02cb046bdb730c Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Sat, 25 May 2019 16:23:58 +0200 Subject: More clever highlighting, incl draft for structs --- crates/ra_cli/src/main.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'crates/ra_cli') diff --git a/crates/ra_cli/src/main.rs b/crates/ra_cli/src/main.rs index 93aba4c70..bdc7a76c6 100644 --- a/crates/ra_cli/src/main.rs +++ b/crates/ra_cli/src/main.rs @@ -16,7 +16,10 @@ fn main() -> Result<()> { .setting(clap::AppSettings::SubcommandRequiredElseHelp) .subcommand(SubCommand::with_name("parse").arg(Arg::with_name("no-dump").long("--no-dump"))) .subcommand(SubCommand::with_name("symbols")) - .subcommand(SubCommand::with_name("highlight")) + .subcommand( + SubCommand::with_name("highlight") + .arg(Arg::with_name("rainbow").short("r").long("rainbow")) + ) .subcommand( SubCommand::with_name("analysis-stats") .arg(Arg::with_name("verbose").short("v").long("verbose")) @@ -39,9 +42,9 @@ fn main() -> Result<()> { println!("{:?}", s); } } - ("highlight", _) => { + ("highlight", Some(matches)) => { let (analysis, file_id) = Analysis::from_single_file(read_stdin()?); - let html = analysis.highlight_as_html(file_id).unwrap(); + let html = analysis.highlight_as_html(file_id, matches.is_present("rainbow")).unwrap(); println!("{}", html); } ("analysis-stats", Some(matches)) => { -- cgit v1.2.3 From 5abcca516d3563416d3fba9f2e4b8b024d10f846 Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Sun, 26 May 2019 11:56:31 +0200 Subject: make it build again --- crates/ra_cli/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_cli') diff --git a/crates/ra_cli/src/main.rs b/crates/ra_cli/src/main.rs index bdc7a76c6..84a1564ce 100644 --- a/crates/ra_cli/src/main.rs +++ b/crates/ra_cli/src/main.rs @@ -18,7 +18,7 @@ fn main() -> Result<()> { .subcommand(SubCommand::with_name("symbols")) .subcommand( SubCommand::with_name("highlight") - .arg(Arg::with_name("rainbow").short("r").long("rainbow")) + .arg(Arg::with_name("rainbow").short("r").long("rainbow")), ) .subcommand( SubCommand::with_name("analysis-stats") -- cgit v1.2.3