Skip to content

Program arguments

args is the command line handed to the program you are debugging.

[profiles.web]
adapter = "debugpy"
program = "manage.py"
args = ["runserver", "--noreload", "8000"]

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:

args = ["--config", "${root}/configs/dev.yaml"]

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

[profiles.api]
adapter = "dlv"
program = "cmd/api"
args = ["--config", "${root}/configs/dev.yaml", "--verbose"]
[profiles.cli]
adapter = "codelldb"
program = "target/debug/cli"
args = ["import", "--dry-run", "${root}/fixtures/sample.csv"]
[profiles.web]
adapter = "debugpy"
program = "manage.py"
args = ["runserver", "--noreload", "8000"]

PHP takes no args: the adapter launches nothing, so there is no command line to give. See Languages → PHP.