More clever highlighting, incl draft for structs

This commit is contained in:
Pascal Hertleif 2019-05-25 16:23:58 +02:00
parent ed89b0638b
commit 43d5a49653
No known key found for this signature in database
GPG key ID: EDBB1A8D2047A074
10 changed files with 159 additions and 414 deletions

View file

@ -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)) => {