7use std::{env, error::Error};
9type DynError = Box<dyn Error>;
12 use crate::docgen::{lang_features, typable_commands, write};
13 use crate::docgen::{LANG_SUPPORT_MD_OUTPUT, TYPABLE_COMMANDS_MD_OUTPUT};
14 use crate::querycheck::query_check;
15 use crate::themelint::{lint, lint_all};
18 pub fn docgen() -> Result<(), DynError> {
19 write(TYPABLE_COMMANDS_MD_OUTPUT, &typable_commands()?);
20 write(LANG_SUPPORT_MD_OUTPUT, &lang_features()?);
24 pub fn themelint(file: Option<String>) -> Result<(), DynError> {
26 Some(file) => lint(file),
31 pub fn querycheck() -> Result<(), DynError> {
38Usage: Run with `cargo xtask <task>`, eg. `cargo xtask docgen`.
41 docgen: Generate files to be included in the mdbook output.
42 themelint <theme>: Report errors for <theme>, or all themes if no theme is specified.
43 query-check: Check that tree-sitter queries are valid.
49fn main() -> Result<(), DynError> {
50 let task = env::args().nth(1);
52 None => tasks::print_help(),
53 Some(t) => match t.as_str() {
54 "docgen" => tasks::docgen()?,
55 "themelint" => tasks::themelint(env::args().nth(2))?,
56 "query-check" => tasks::querycheck()?,
57 invalid => return Err(format!("Invalid task name: {}", invalid).into()),
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list