Rudziankoŭ
Rudziankoŭ

Reputation: 11251

Passing arguments to executable when debugging with Delve

I would like to pass arguments to the binary file when executing it with dlv

dlv --listen=:5432 exec /mypath/binary --config=config.toml

But when I am doing it I get following error:

Error: unknown flag: --config

How can I pass arguments to binary when using dlv debugger?

Upvotes: 16

Views: 9115

Answers (1)

user142162
user142162

Reputation:

Add -- to tell dlv that all subsequent arguments should be passed verbatim to the binary, without trying to parse them:

dlv --listen=:5432 exec /mypath/binary -- --config=config.toml

See Delve - Getting Started.

Upvotes: 34

Related Questions