Skip to content

concise syntax for command line calls #1

@TyRoXx

Description

@TyRoXx

Starting a process with arguments is currently very verbose and less readable than an equivalent shell script.

std::vector<Si::os_string> arguments;
arguments.emplace_back(SILICIUM_OS_STR("--build"));
arguments.emplace_back(SILICIUM_OS_STR("."));
int rc = ventura::run_process(cmake_exe, arguments, build_dir, output).get();

We can certainly do without emplace_back by using Boost.Assign or something similar.
The SILICIUM_OS_STR is only a micro-optimization. We should prefer strings to be UTF-8, so arguments could be std::vector<std::string> instead.
Maybe it should look like this?

int rc = ventura::run_process(cmake_exe, ventura::args("--build")("."),
   build_dir, output).get();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions