Program arguments¶
args is the command line handed to the program you are debugging.
One element per argument¶
args is a list, not a string, and each element is one argument. This matters
whenever a value contains a space:
args = ["--message", "hello world"] # two arguments
args = ["--message hello world"] # one argument, almost certainly wrong
There is no shell involved: no word splitting, no glob expansion, no variable
substitution beyond ${root} below. What you write is what the program's
argv receives.
${root}¶
${root} expands to the absolute path of the project root:
Use it whenever the program needs an absolute path. A bare relative path also works — it is resolved by the program itself, against its working directory, which is the project root by default.
Arguments that look like flags of the debugger¶
There is no ambiguity: args goes to the debuggee and nothing in it is
interpreted by Bugsaur. A profile with args = ["--project", "x"] passes
--project x to your program.
The test-under-cursor flow replaces args¶
When you debug the test under the cursor — :DebugTest or --test-at — the
program and its arguments are substituted for the ones the selected test needs.
Everything else from the profile — adapter, environment, working directory — is
inherited unchanged.
That is why you do not add pytest or cargo test arguments to a profile in
order to debug one test: those are supplied by the test flow itself.
Examples¶
PHP takes no args: the adapter launches nothing, so there is no command
line to give. See Languages → PHP.
Related¶
- Environment variables — for configuration passed as
envrather than on the command line. - Guides → Pass arguments and environment — worked recipes.