Cargo command to work with Nintendo 3DS project binaries.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
use clap::{AppSettings, Args, Parser, ValueEnum};
|
|
|
|
|
|
|
|
#[derive(Parser)]
|
|
|
|
#[clap(name = "cargo")]
|
|
|
|
#[clap(bin_name = "cargo")]
|
|
|
|
pub enum Cargo {
|
|
|
|
#[clap(name = "3ds")]
|
|
|
|
Input(Input),
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Args)]
|
|
|
|
#[clap(about)]
|
|
|
|
#[clap(global_setting(AppSettings::AllowLeadingHyphen))]
|
|
|
|
pub struct Input {
|
|
|
|
#[clap(value_enum)]
|
|
|
|
pub cmd: CargoCommand,
|
|
|
|
pub cargo_opts: Vec<String>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(ValueEnum, Copy, Clone, Ord, PartialOrd, Eq, PartialEq)]
|
|
|
|
pub enum CargoCommand {
|
|
|
|
Build,
|
|
|
|
Run,
|
|
|
|
Test,
|
|
|
|
Check,
|
|
|
|
Clippy,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl CargoCommand {
|
|
|
|
pub fn should_build_3dsx(&self) -> bool {
|
|
|
|
matches!(
|
|
|
|
self,
|
|
|
|
CargoCommand::Build | CargoCommand::Run | CargoCommand::Test
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|