diff options
author | P. J. McDermott <pj@pehjota.net> | 2015-10-27 12:47:45 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2015-10-27 12:47:45 (EDT) |
commit | d1bb2690d4892c63db6de266dfdde9dc434a187d (patch) | |
tree | a69fd14b53b4b77f11795cc888284017db59e0ee | |
parent | 33b86b5b03a29264812790aaff0e492c36a9fbe5 (diff) | |
download | firman.sh-d1bb2690d4892c63db6de266dfdde9dc434a187d.zip firman.sh-d1bb2690d4892c63db6de266dfdde9dc434a187d.tar.gz firman.sh-d1bb2690d4892c63db6de266dfdde9dc434a187d.tar.bz2 |
ui/cli: Write warnings and errors to stderr
Also put dbg() before other functions.
-rw-r--r-- | src/ui.sh | 2 | ||||
-rw-r--r-- | src/ui/cli.sh | 16 |
2 files changed, 9 insertions, 9 deletions
@@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -ui_functions='info warn err dbg show_menu' +ui_functions='dbg info warn err show_menu' init_ui() { diff --git a/src/ui/cli.sh b/src/ui/cli.sh index 16321b8..a396625 100644 --- a/src/ui/cli.sh +++ b/src/ui/cli.sh @@ -15,34 +15,34 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -cli_info() +cli_dbg() { local fmt="${1}" shift 1 - printf "${fmt}\n" "${@}" + printf "Debug: ${fmt}\n" "${@}" } -cli_warn() +cli_info() { local fmt="${1}" shift 1 - printf "Warning: ${fmt}\n" "${@}" + printf "${fmt}\n" "${@}" } -cli_err() +cli_warn() { local fmt="${1}" shift 1 - printf "Error: ${fmt}\n" "${@}" + printf "Warning: ${fmt}\n" "${@}" >&2 } -cli_dbg() +cli_err() { local fmt="${1}" shift 1 - printf "Debug: ${fmt}\n" "${@}" + printf "Error: ${fmt}\n" "${@}" >&2 } |