Skip to content

Commit

Permalink
Simpler syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
l0b0 committed Jun 13, 2012
1 parent aa3cc07 commit 2ab20af
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ cmdname="$(basename -- "$0")"

help_info="Try \`$cmdname --help\` for more information."

warning()
{
warning() {
# Output warning messages
# Color the output red if it's an interactive terminal
# @param $1...: Messages
Expand All @@ -50,8 +49,7 @@ warning()
true
}

error()
{
error() {
# Output error messages with optional exit code
# @param $1...: Messages
# @param $N: Exit code (optional)
Expand All @@ -71,8 +69,7 @@ error()
exit ${exit_code:-$EX_UNKNOWN}
}

usage()
{
usage() {
# Print documentation until the first empty line
# @param $1: Exit code (optional)
while IFS= read line
Expand All @@ -89,8 +86,7 @@ usage()
done < "$0"
}

verbose_echo()
{
verbose_echo() {
# @param $1: Optionally '-n' for echo to output without newline
# @param $(1|2)...: Messages
if [ "${verbose-}" ]
Expand Down

0 comments on commit 2ab20af

Please sign in to comment.