fix: add --project/--program to BatchArgs and fix arg order in tests

BatchArgs was missing --project and --program fields, so batch commands
couldn't specify which project to use. Also fixed argument ordering in
all test files to place --project/--program after the subcommand name,
matching clap's per-subcommand argument parsing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alexander Kiselev
2026-02-05 13:19:16 -08:00
co-authored by Claude Opus 4.6
parent 1e0837dd31
commit ae2d882f26
14 changed files with 108 additions and 100 deletions
+8 -8
View File
@@ -22,10 +22,10 @@ fn test_program_info() {
Command::cargo_bin("ghidra")
.unwrap()
.arg("--project")
.arg(TEST_PROJECT)
.arg("program")
.arg("info")
.arg("--project")
.arg(TEST_PROJECT)
.arg("--program")
.arg(TEST_PROGRAM)
.assert()
@@ -47,11 +47,11 @@ fn test_program_export_json() {
Command::cargo_bin("ghidra")
.unwrap()
.arg("--project")
.arg(TEST_PROJECT)
.arg("program")
.arg("export")
.arg("json")
.arg("--project")
.arg(TEST_PROJECT)
.arg("--program")
.arg(TEST_PROGRAM)
.assert()
@@ -72,10 +72,10 @@ fn test_program_close() {
Command::cargo_bin("ghidra")
.unwrap()
.arg("--project")
.arg(TEST_PROJECT)
.arg("program")
.arg("close")
.arg("--project")
.arg(TEST_PROJECT)
.arg("--program")
.arg(TEST_PROGRAM)
.assert()
@@ -95,10 +95,10 @@ fn test_program_info_no_program() {
Command::cargo_bin("ghidra")
.unwrap()
.arg("--project")
.arg(TEST_PROJECT)
.arg("program")
.arg("info")
.arg("--project")
.arg(TEST_PROJECT)
.assert()
.failure();