dsh

DSH provides conveniences that make it easier to write simple scripts in D.

Several phobos modules are preemptively imported so that you don't need to do so in your script. Additionally, helper functions are defined which are especially useful for scripts.

Public Imports

std.stdio
public import std.stdio;
Undocumented in source.
std.file
public import std.file;
Undocumented in source.

Members

Classes

ProcessBuilder
class ProcessBuilder

Helper for more easily creating processes.

Functions

error
void error(string s, Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
getEnv
string getEnv(string key)

Gets an environment variable.

isDirEmpty
bool isDirEmpty(string dir)

Checks if a directory is empty.

print
void print(string s, Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
replaceAll
string replaceAll(string s, string pattern, string r)

Convenience method to replace all occurrences of matching patterns with some other string.

run
int run(string cmd)

Runs the given command using the user's shell.

runOrQuit
void runOrQuit(string cmd)

Runs the given command, and exits the program if the return code is not 0.

setEnv
void setEnv(string key, string value)

Sets an environment variable.

sleepMillis
void sleepMillis(long amount)

Sleeps for a specified amount of milliseconds.

sleepSeconds
void sleepSeconds(long amount)

Sleeps for a specified amount of seconds.

Meta