mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-22 13:22:28 +00:00
01d571fc9e
* remove contributing guidelines duplicate `docs/contributing.md` is now auto generated * Commit Contributing Guidelines * core `xtask` functionality * almost there * write panic * almost almost there * there. * remove empty descriptions * better contributing.md comment * Commit Contributing Guidelines * remove entries without descriptions --------- Co-authored-by: adamperkowski <adamperkowski@users.noreply.github.com>
41 lines
794 B
Rust
41 lines
794 B
Rust
mod docgen;
|
|
mod path;
|
|
|
|
use std::{env, error::Error};
|
|
|
|
type DynError = Box<dyn Error>;
|
|
|
|
pub mod tasks {
|
|
use crate::docgen::USER_GUIDE;
|
|
use crate::docgen::{userguide, write};
|
|
use crate::DynError;
|
|
|
|
pub fn docgen() -> Result<(), DynError> {
|
|
write(USER_GUIDE, &userguide()?);
|
|
Ok(())
|
|
}
|
|
|
|
pub fn print_help() {
|
|
println!(
|
|
"
|
|
Usage: `cargo xtask <task>`
|
|
|
|
Tasks:
|
|
docgen: Generate Markdown files.
|
|
"
|
|
);
|
|
}
|
|
}
|
|
|
|
fn main() -> Result<(), DynError> {
|
|
let task = env::args().nth(1);
|
|
match task {
|
|
None => tasks::print_help(),
|
|
Some(t) => match t.as_str() {
|
|
"docgen" => tasks::docgen()?,
|
|
invalid => return Err(format!("Invalid task: {}", invalid).into()),
|
|
},
|
|
};
|
|
Ok(())
|
|
}
|