diff --git a/firestarter b/firestarter index 6e92baf..0d75088 100755 --- a/firestarter +++ b/firestarter @@ -19,12 +19,14 @@ exec 1023<> <(:) # Basic functions print() { # Write a message to STDOUT without a name attached + # 1: That message [ -z "$1" ] && return 1 printf "%s\\n" \ "$1" } log() { # Write a message to STDOUT + # 1: That message [ -z "$1" ] && return 1 printf "%s log: %s\\n" \ "$_name" \ @@ -32,6 +34,8 @@ log() { } err() { # Write a message to STDERR, also exit if arg 2 is specified + # 1: That message + # 2: An optional exit code (will only exit if provided) [ -z "$1" ] && return 1 printf "%s err: %s\\n" \ "$_name" \ @@ -44,11 +48,14 @@ err() { fi } has() { + # See if a program exists in $PATH + # 1: A program [ -z "$1" ] && return 1 command -v "$1" > /dev/null 2>&1 } gettarget() { # Parse a defaults file to get the target program + # 1: A defaults file [ -z "$1" ] && return 1 [ -r "$1" ] || return 1 # Every odd line is the check line