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

2
src/lib.rs

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

5
src/main.rs

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

Loading…
Cancel
Save