aboutsummaryrefslogtreecommitdiff
path: root/lib/_ak_script
diff options
context:
space:
mode:
Diffstat (limited to 'lib/_ak_script')
-rwxr-xr-xlib/_ak_script27
1 files changed, 20 insertions, 7 deletions
diff --git a/lib/_ak_script b/lib/_ak_script
index 1be8710..241c182 100755
--- a/lib/_ak_script
+++ b/lib/_ak_script
@@ -17,7 +17,8 @@
### You should have received a copy of the GNU General Public License
### along with this program. If not, see <http://www.gnu.org/licenses/>.
###
-source ./lib/_ak_log > /dev/null 2>&1 || source $AK_LIBDIR/_ak_log > /dev/null 2>&1
+source ./lib/_ak_lib_load > /dev/null 2>&1 || source $AK_LIBDIR/_ak_lib_load > /dev/null 2>&1
+_ak_lib_load _ak_log
# Wanna talk about it?
function _ak_new_line(){
@@ -85,11 +86,23 @@ function _ak_title_description(){
}
function _ak_usage(){
- (
- _ak_title_description 2>&1
- _ak_license 2>&1
- _ak_help 2>&1
- ) | sed 's/^/# /g' | while read line; do _ak_log_info "${line}"; done
+ if [ ! -z $1 ] && [ -n "$1" ] && [ "$1" == "err" ]
+ then
+ (
+ _ak_title_description 2>&1
+ _ak_license 2>&1
+ _ak_help 2>&1
+ # ) | sed 's/^/# /g' | while read line; do _ak_log_info "${line}"; done
+ ) 1>&2
+ exit 1
+ else
+ (
+ _ak_title_description 2>&1
+ _ak_license 2>&1
+ _ak_help 2>&1
+ # ) | sed 's/^/# /g' | while read line; do _ak_log_info "${line}" 2>&1; done
+ )
+ fi
}
function _ak_print_version(){
@@ -219,4 +232,4 @@ function _ak_countdown_seconds(){
printf "\n"
}
-_ak_log_debug "_ak_script loaded $(caller)"
+# _ak_log_debug "_ak_script loaded $(caller)"