'Provide arguments to dune rules

Is it possible to provide arguments like you would do with dune exec -- my_exe.exe <arguments> when using rules?

I currently have the following dune file

(executable
 (name my_exe)
 (libraries unix))

(rule
 (alias my_exe)
 (deps my_exe.exe)
 (action (run %{exe:my_exe.exe})))

My my_exe.ml file contains command line arguments parsing and I'd like to invoke it with

dune build @my_exe -- --path path/to/file

Since this would work

dune exec ./path/to/my_exe.exe -- --path path/to/file


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source