package org.implab.gradle.common.exec;

public interface Shell {

    ShellExec of(CommandSpec spec);

    /** Creates a new shell to start processes using ProcessBuilder. */
    static Shell system() {
        return spec -> new SystemExecBuilder(spec);
    }

    /** Creates a stub shell which echoes the specified command line. */
    static Shell echo() {
        return spec -> new EchoExecBuilder(spec, false);
    }

    /** Creates a stub shell which echoes the specified command line. */
    static Shell echoStderr() {
        return spec -> new EchoExecBuilder(spec, false);
    }

}
