How to avoid passing arguments with quotation marks in Eio.Process.run?

Hi. I’m trying to use Eio on Linux. The following

Eio.Process.run proc_mgr ["path/to/main.exe"; "-arg1 value1"; "-arg2 value2"];

yields

path/to/main.exe: unknown option '-arg1 value1'.

Uncaught exception:
  
  Eio.Io Process Child_error Exited (code 2),
  running command: path/to/main.exe "-arg1 value1" "-arg2 value2"

which I assume to be the case due to the quotation marks in the arguments, since

$ path/to/main.exe -arg1 value1 -arg2 value2

is successful and yields the expected output.

If my assumption is correct, is there any way to avoid the quotation marks? I was not able not find this in the API.

1 Like

Each separate argument should be its own item in the argument list:

Eio.Process.run proc_mgr ["path/to/main.exe"; "-arg1”; “value1"; "-arg2”; ”value2"];
2 Likes

Or rather, each separate ‘word’, even if you would normally consider part of the same command-line flag.

Of course! Thanks a lot :slight_smile:

1 Like