Browse Source

Add AllowLeadingHyphen

pull/21/head
Steve Cook 2 years ago
parent
commit
51917f8fcf
  1. 3
      src/commands/mod.rs
  2. 2
      src/lib.rs
  3. 5
      src/main.rs

3
src/commands/mod.rs

@ -1,7 +1,8 @@
use clap::{ValueEnum, Parser}; use clap::{ValueEnum, Parser, AppSettings};
use std::fmt::{Display, Formatter}; use std::fmt::{Display, Formatter};
#[derive(Parser)] #[derive(Parser)]
#[clap(global_setting(AppSettings::AllowLeadingHyphen))]
pub struct Input { pub struct Input {
#[clap(value_enum)] #[clap(value_enum)]
pub cmd: CargoCommand, pub cmd: CargoCommand,

2
src/lib.rs

@ -59,6 +59,8 @@ fn make_cargo_build_command(
command.arg("-Z").arg("build-std"); command.arg("-Z").arg("build-std");
} }
println!("{:?}", args);
command command
.env("RUSTFLAGS", rust_flags) .env("RUSTFLAGS", rust_flags)
.arg(&cmd.to_string()) .arg(&cmd.to_string())

5
src/main.rs

@ -1,6 +1,6 @@
use cargo_3ds::commands::{CargoCommand, Input}; use cargo_3ds::commands::{CargoCommand, Input};
use cargo_3ds::{build_3dsx, build_elf, build_smdh, check_rust_version, get_metadata, link}; use cargo_3ds::{build_3dsx, build_elf, build_smdh, check_rust_version, get_metadata, link};
use clap::Parser; use clap::{Parser};
use std::process; use std::process;
fn main() { fn main() {
@ -17,8 +17,7 @@ fn main() {
true true
}); });
let message_format = if let Some(pos) = input let message_format = if let Some(pos) = input.cargo_opts
.cargo_opts
.iter() .iter()
.position(|s| s.starts_with("--message-format")) .position(|s| s.starts_with("--message-format"))
{ {

Loading…
Cancel
Save