2023-10-18 05:14:24 -05:00
|
|
|
mod fmt;
|
|
|
|
mod utils;
|
|
|
|
|
2024-07-08 00:22:53 -05:00
|
|
|
use {
|
|
|
|
argh::FromArgs,
|
|
|
|
std::{io, path::Path},
|
|
|
|
};
|
2023-10-18 05:14:24 -05:00
|
|
|
|
2024-07-08 00:27:40 -05:00
|
|
|
fn root() -> &'static Path {
|
|
|
|
Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap()
|
|
|
|
}
|
2023-10-18 05:14:24 -05:00
|
|
|
|
|
|
|
/// xTask for Holey Bytes project
|
|
|
|
#[derive(FromArgs)]
|
|
|
|
struct Command {
|
|
|
|
#[argh(subcommand)]
|
|
|
|
subcom: Subcommands,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(FromArgs)]
|
|
|
|
#[argh(subcommand)]
|
|
|
|
enum Subcommands {
|
|
|
|
Format(fmt::Command),
|
|
|
|
}
|
|
|
|
|
2024-07-08 00:22:53 -05:00
|
|
|
fn main() -> io::Result<()> {
|
2023-10-18 05:14:24 -05:00
|
|
|
match argh::from_env::<Command>().subcom {
|
|
|
|
Subcommands::Format(com) => fmt::command(com),
|
|
|
|
}
|
|
|
|
}
|