Skip to content

sim_vehicle.py: stack -A options in an array rather than splitting on…#31838

Open
peterbarker wants to merge 1 commit intoArduPilot:masterfrom
peterbarker:pr/stack-a-options
Open

sim_vehicle.py: stack -A options in an array rather than splitting on…#31838
peterbarker wants to merge 1 commit intoArduPilot:masterfrom
peterbarker:pr/stack-a-options

Conversation

@peterbarker
Copy link
Contributor

… space

e.g. ./Tools/autotest/sim_vehicle.py -v Copter --gdb --debug --map --console -A --serial5=sim:gps:3 -A --serial6=sim:gps:4

Tested in SITL.

Stacking works, as does splitting with spaces... i.e. these both work:

./Tools/autotest/sim_vehicle.py -v Copter --gdb --debug -A -"-serial5=uart:/tmp/x --serial6=uart:/tmp/y"

and

./Tools/autotest/sim_vehicle.py -v Copter --gdb --debug -A --serial5=uart:/tmp/x -A --serial6=uart:/tmp/y

… space

e.g. ./Tools/autotest/sim_vehicle.py -v Copter --gdb --debug --map --console -A --serial5=sim:gps:3 -A --serial6=sim:gps:4
Copy link
Contributor

@tpwrules tpwrules left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks decent overall.

Unfortunate this still works, but I think it needs to be fixed at another layer. ./Tools/autotest/sim_vehicle.py -v Copter --gdb --debug -A -"-serial5=uart:/tmp/x --serial6=uart:/tmp/y"

@@ -771,7 +771,7 @@ def start_vehicle(binary, opts, stuff, spawns=None):
cmd.extend(["--enable-fgview"])
if opts.sitl_instance_args:
# this could be a lot better:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this comment anymore?

@peterbarker
Copy link
Contributor Author

peterbarker commented Jan 10, 2026 via email

@tpwrules
Copy link
Contributor

Which option is “the old one”?

@peterbarker
Copy link
Contributor Author

Which option is “the old one”?

The option to stack everything into a single -A and splitting on spaces.

@tpwrules
Copy link
Contributor

I don't think we have such an option in this script per se. I think something lower down is splitting on spaces now. It is better in this script so I think the comment should be removed.

@peterbarker
Copy link
Contributor Author

I don't think we have such an option in this script per se. I think something lower down is splitting on spaces now. It is better in this script so I think the comment should be removed.

Oh, whoops! I forgot the shape of this PR.

It's a bit rude to just up-and-break people's current scripts.

I'm kind of OK with it as it's only going to be advanced users using -A anyway, and they'll work things out pretty rapidly...

I could add a little bit of code that detects spaces in the arguments and errors out as "compatability" code for a couple of years?

@tpwrules
Copy link
Contributor

tpwrules commented Feb 1, 2026

I think adding that code to reject spaces would defeat the benefit of the new option! I think the comment should be removed, then later we can find and fix what else is breaking on spaces. At that time we can decide if there needs to be a warning period.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ReadyForDevCall

Development

Successfully merging this pull request may close these issues.

2 participants