From 1e4a96730da70fcfa3b8c153874cbdebad0f9829 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 27 Jan 2013 19:41:28 +0100 Subject: o Starting on a style guide. app-conf: Adding 'import' command. app-cat-conf: Adding support for multiple -f flags. The default files can be switched off. A file named "-" is the same as /dev/stdin. app: Adding a way to enable debugging. app-install-file: Import any configuration delivered with the package. --- lib/common | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/common b/lib/common index 8c33209..d53f0cf 100644 --- a/lib/common +++ b/lib/common @@ -39,6 +39,14 @@ assert_is_app() { fi } +debug() { + [[ $echo_debug == no ]] || echo "D: $usage_app: $@" 2>&1 +} + +info() { + echo "I: $usage_app: $@" 2>&1 +} + fatal() { echo "$usage_app: fatal: $@" 2>&1 exit 1 @@ -192,4 +200,5 @@ run_app() { PATH=$PATH:$APPSH_HOME/bin:$APPSH_HOME/libexec # Save for later -usage_app=$0 +usage_app=${0##*/} +echo_debug=${echo_debug-no} -- cgit v1.2.3