mirror of
https://github.com/lifegpc/msg-tool.git
synced 2026-07-08 01:31:53 +08:00
Add cond compile for some command line arguments
This commit is contained in:
@@ -57,6 +57,7 @@ pub struct Arg {
|
|||||||
)]
|
)]
|
||||||
/// Archive code page
|
/// Archive code page
|
||||||
pub archive_code_page: Option<u32>,
|
pub archive_code_page: Option<u32>,
|
||||||
|
#[cfg(feature = "circus")]
|
||||||
#[arg(long, value_enum, global = true)]
|
#[arg(long, value_enum, global = true)]
|
||||||
/// Circus Game
|
/// Circus Game
|
||||||
pub circus_mes_type: Option<CircusMesType>,
|
pub circus_mes_type: Option<CircusMesType>,
|
||||||
@@ -66,6 +67,7 @@ pub struct Arg {
|
|||||||
#[arg(global = true, action = ArgAction::SetTrue, short, long)]
|
#[arg(global = true, action = ArgAction::SetTrue, short, long)]
|
||||||
/// Print backtrace on error
|
/// Print backtrace on error
|
||||||
pub backtrace: bool,
|
pub backtrace: bool,
|
||||||
|
#[cfg(feature = "escude-arc")]
|
||||||
#[arg(long, action = ArgAction::SetTrue, global = true)]
|
#[arg(long, action = ArgAction::SetTrue, global = true)]
|
||||||
/// Whether to use fake compression for Escude archive
|
/// Whether to use fake compression for Escude archive
|
||||||
pub escude_fake_compress: bool,
|
pub escude_fake_compress: bool,
|
||||||
|
|||||||
@@ -985,7 +985,9 @@ fn main() {
|
|||||||
unsafe { std::env::set_var("RUST_LIB_BACKTRACE", "1") };
|
unsafe { std::env::set_var("RUST_LIB_BACKTRACE", "1") };
|
||||||
}
|
}
|
||||||
let cfg = types::ExtraConfig {
|
let cfg = types::ExtraConfig {
|
||||||
|
#[cfg(feature = "circus")]
|
||||||
circus_mes_type: arg.circus_mes_type.clone(),
|
circus_mes_type: arg.circus_mes_type.clone(),
|
||||||
|
#[cfg(feature = "escude-arc")]
|
||||||
escude_fake_compress: arg.escude_fake_compress.clone(),
|
escude_fake_compress: arg.escude_fake_compress.clone(),
|
||||||
};
|
};
|
||||||
match &arg.command {
|
match &arg.command {
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ impl AsRef<str> for OutputScriptType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "circus")]
|
||||||
#[derive(Clone, Copy, Debug, ValueEnum, PartialEq, Eq, PartialOrd, Ord)]
|
#[derive(Clone, Copy, Debug, ValueEnum, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
pub enum CircusMesType {
|
pub enum CircusMesType {
|
||||||
/// fortissimo//Akkord:Bsusvier
|
/// fortissimo//Akkord:Bsusvier
|
||||||
@@ -146,6 +147,7 @@ pub enum CircusMesType {
|
|||||||
Nightshade,
|
Nightshade,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "circus")]
|
||||||
impl AsRef<str> for CircusMesType {
|
impl AsRef<str> for CircusMesType {
|
||||||
fn as_ref(&self) -> &str {
|
fn as_ref(&self) -> &str {
|
||||||
match self {
|
match self {
|
||||||
@@ -185,7 +187,9 @@ impl AsRef<str> for CircusMesType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub struct ExtraConfig {
|
pub struct ExtraConfig {
|
||||||
|
#[cfg(feature = "circus")]
|
||||||
pub circus_mes_type: Option<CircusMesType>,
|
pub circus_mes_type: Option<CircusMesType>,
|
||||||
|
#[cfg(feature = "escude-arc")]
|
||||||
pub escude_fake_compress: bool,
|
pub escude_fake_compress: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user