sebdah/vim-delve

What format is DlvExec expecting arguments?

Opened this issue · 3 comments

thams commented

DlvExec ~/go/bin/acommand anargument

results in:

zsh:cd:1: no such file or directory: anargument

But any quoting of the command causes DlvExec to just split the buffer window.

thams commented

Ah, looks like correct is:
DlvExec ~/go/bin/acommand -- anargument

I discovered that DlvExec expects something like the following (using neovim) at the time of writing:

:DlvExec ./program . --\ subcommand\ subsubcommand

For its second argument it expects the directory to run in, for its second and final argument, it accepts one string. So you'll have to escape the space as needed.

dzuqe commented

I found myself directly called the runCommand as I have much more complex args

call delve#runCommand("exec ./path/to/binary", "-- -c ./config.json", ".")

Found this in the following function

vim-delve/plugin/delve.vim

Lines 185 to 189 in d0729de

function! delve#dlvExec(bin, ...)
let dir = (a:0 > 0) ? a:1 : "."
let flags = (a:0 > 1) ? a:2 : ""
call delve#runCommand("exec ". a:bin, flags, dir)
endfunction