Runs an arbitrary child process and waits for its termination, while delegating the standard input, output and error to the child.
CARGO_NET_GIT_FETCH_WITH_CLI=true cargo install --git https://git.wilem.eu/exewrapper.git
The wrapper will look for a config file at self path plus .conf
at the end. For example, the wrapper is at C:\Users\ivan\bin\ashcmd.exe
. The config file will be looked for at C:\Users\ivan\bin\ashcmd.exe.conf
.
Full config contents with examples:
bin = 'C:\Users\ivan\bin\busybox.exe'
args = ["ash", "-c"]
rust_args = false
rust_args_as_one = false
debug = false
[env]
HOME = 'C:\Users\ivan'
Everything but bin
is optional.
rust_args_as_one = true
will concatenate all exewrapper
’s arguments with a space and provide it as a single argument to the child process. For example, with the config above, running ashcmd.exe echo 'hello world'
will run
C:\Users\ivan\bin\busybox.exe
ash
-c
echo 'hello world'
With cli_args_as_one = false
it would’ve been
-c
echo
'hello
world'
rust_args = false
disables Rust’s stdlib handling of the command line on Windows and bypasses the command line as is, as a single argument. This leaves the command line intact, whereas the Rust’s stdlib processing removes double quotes and does more stuff.
[env]
section allows setting / overriding environment variables for the child process.