Module garden::cmd[][src]

Expand description

Command utilities

Functions

capture_stdout

Return a CaptureData result for a subprocess’s stdout.

current_exe

Return the current executable path.

exec_cmd

Return a subprocess::Exec for a command.

exec_in_context

Run a command in the specified tree context. Parameters:

exec_in_dir

Return a subprocess::Exec that runs a command in the specified directory.

parse_args

Parse arguments or exit with an error.

resolve_command

The command might be a path that only exists inside the resolved environment. Resolve the path by looking for the presence of PATH and updating the command when it exists.

result_from_exit_status

Convert an exit status to Result<(), GardenError>.

run

Return a subprocess::Exec instance from a command vector.

split_on_dash

Split a vector into two vectors – pre-dash and post-dash

status

Extract the return status from subprocess::Resultsubprocess::ExitStatus.

trim_stdout

Take a subprocess capture and return a string without trailing whitespace.