aboutsummaryrefslogtreecommitdiff
path: root/crates/xa65/src/main.rs
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-04-30 12:21:20 +0200
committerMiquel Sabaté Solà <mssola@mssola.com>2026-04-30 12:42:55 +0200
commita7bf22ce402256c3a056ac278629552ef4978da2 (patch)
tree952b6fd0df8f3a5d2614d67b90b683689352a295 /crates/xa65/src/main.rs
parent6a9dea943c078876061eda0f6203647b0c5aadd4 (diff)
downloadtools.nes-a7bf22ce402256c3a056ac278629552ef4978da2.tar.gz
tools.nes-a7bf22ce402256c3a056ac278629552ef4978da2.zip
nasm/xa65: add the --allow-unused option
Since the addition of the check() function in commit 6a9dea943c07 ("Add a new 'check' stage in assemble()"), it can be annoying to some users that the check for unused/unreferenced object applies by default. Hence, add a flag so this can be disabled. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'crates/xa65/src/main.rs')
-rw-r--r--crates/xa65/src/main.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/xa65/src/main.rs b/crates/xa65/src/main.rs
index abf866b..77e5127 100644
--- a/crates/xa65/src/main.rs
+++ b/crates/xa65/src/main.rs
@@ -18,6 +18,7 @@ struct Args {
no_errors: bool,
strict: bool,
stats: bool,
+ allow_unused: bool,
}
// Print the help message and quit.
@@ -25,6 +26,7 @@ fn print_help() {
println!("Bridge between 'nasm' and 'ca65'.\n");
println!("usage: xa65 [OPTIONS] <FILE>\n");
println!("Options:");
+ println!(" --allow-unused\tPass the '--allow-unused' flag to 'nasm'.");
println!(" -b, --bin <PROGRAM>\tAlternative to the binary for 'nasm'.");
println!(" -C, --config <FILE>\tLinker configuration to be used, whether an identifier or a file path.");
println!(" -h, --help\t\tPrint this message.");
@@ -48,6 +50,7 @@ fn parse_arguments() -> Args {
while let Some(arg) = args.next() {
match arg.as_str() {
+ "--allow-unused" => res.allow_unused = true,
"-b" | "--bin" => match res.bin {
Some(_) => die("only specify the '-b/--bin' flag once".to_string()),
None => match args.next() {
@@ -263,6 +266,9 @@ fn main() {
if args.stats {
cmd.arg("--stats");
}
+ if args.allow_unused {
+ cmd.arg("--allow-unused");
+ }
// Actually run the command.
match cmd.status() {