From 66edbfd03c2c697069173c733b8a652a34d868ec Mon Sep 17 00:00:00 2001 From: William Melody Date: Sat, 27 Jun 2015 20:21:58 -0700 Subject: [PATCH] Update `_debug` and `_die` comments. --- hosts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/hosts b/hosts index 5a37359..5f626bc 100755 --- a/hosts +++ b/hosts @@ -55,12 +55,12 @@ HOSTS_PATH="${HOSTS_PATH:-/etc/hosts}" # _debug() # -# A simple function for executing a specified command if the `_use_debug` -# variable has been set. The command is expected to print a message and -# should typically be either `echo`, `printf`, or `cat`. -# # Usage: # _debug printf "Debug info. Variable: %s\n" "$0" +# +# A simple function for executing a specified command if the `$_USE_DEBUG` +# variable has been set. The command is expected to print a message and +# should typically be either `echo`, `printf`, or `cat`. _debug() { if [[ "${_use_debug:-"0"}" -eq 1 ]]; then # Prefix debug message with "bug (U+1F41B)" @@ -71,12 +71,12 @@ _debug() { } # debug() # -# Print the specified message if the `_use_debug` variable has been set. -# -# This is a shortcut for the _debug() function that simply echos the message. -# # Usage: # debug "Debug info. Variable: $0" +# +# Print the specified message if the `$_USE_DEBUG` variable has been set. +# +# This is a shortcut for the _debug() function that simply echos the message. debug() { _debug echo "$@" } @@ -87,12 +87,12 @@ debug() { # _die() # +# Usage: +# _die printf "Error message. Variable: %s\n" "$0" +# # A simple function for exiting with an error after executing the specified # command. The command is expected to print a message and should typically # be either `echo`, `printf`, or `cat`. -# -# Usage: -# _die printf "Error message. Variable: %s\n" "$0" _die() { # Prefix die message with "cross mark (U+274C)", often displayed as a red x. printf "❌ " @@ -101,12 +101,12 @@ _die() { } # die() # +# Usage: +# die "Error message. Variable: $0" +# # Exit with an error and print the specified message. # # This is a shortcut for the _die() function that simply echos the message. -# -# Usage: -# die "Error message. Variable: $0" die() { _die echo "$@" }