Skip to content

Commit

Permalink
chore: Add syntax debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin Blackman committed Dec 28, 2023
1 parent 8c61964 commit ff40cc6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/application/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,17 @@ fn subcommand_debug() -> Command {
.subcommand(
Command::new("syntaxes").about("List all supported code highlighting languages.")
)
.subcommand(
Command::new("resolve-syntax")
.about("Resolves a string to a given highlighting syntax")
.arg(
clap::Arg::new("entry")
.short('s')
.long("entry")
.help("Entry to resolve")
.required(true),
)
)
.subcommand(
Command::new("themes").about("List all supported code highlighting themes.")
)
Expand Down Expand Up @@ -420,6 +431,11 @@ pub async fn parse() -> Result<bool> {
Some(("syntaxes", _)) => {
println!("{}", Syntaxes::list().join("\n"));
}
Some(("resolve-syntax", rs_matches)) => {
let entry = rs_matches.get_one::<String>("entry").unwrap();
let res = Syntaxes::get(entry);
println!("{:?}", res);
}
Some(("themes", _)) => {
println!("{}", Themes::list().join("\n"));
}
Expand Down

0 comments on commit ff40cc6

Please sign in to comment.