From: Nicolas Boisselier Date: Sat, 25 Feb 2017 00:36:50 +0000 (+0000) Subject: bin/nb-install X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=2588ed68e49de62026fdee0d41f8704f3af5bba6;p=nb.git bin/nb-install --- diff --git a/bin/nb-install b/bin/nb-install index 550017fa..aa82dc50 100755 --- a/bin/nb-install +++ b/bin/nb-install @@ -53,6 +53,7 @@ fdiff() { if [ -e /etc/nb/cron.no ]; then rm -f /etc/cron.d/nb else + #shell_help_noarg "zaza" "$@" && exit 0 cron_d_install "$NB_ROOT/etc/cron/nb" "nb-update|$NB_ROOT|NB_LOG" && verbose "Cron: $NB_ROOT/etc/cron/nb" #cron_d_install "test" "" "nico.*true" && verbose "Cron: nico" fi diff --git a/etc/profile.d/functions b/etc/profile.d/functions index 1d0da2f8..173ad523 100644 --- a/etc/profile.d/functions +++ b/etc/profile.d/functions @@ -132,10 +132,11 @@ shell_help() { for i in $@; do case "$i" in -h|-help|--help) - case $OSTYPE in - darwin*) printf "$msg\n" ;; - *) echo -e "$msg" ;; - esac + printf "$msg\n" +# NB 25.02.17 case $OSTYPE in +# NB 25.02.17 darwin*) printf "$msg\n" ;; +# NB 25.02.17 *) echo -e "$msg" ;; +# NB 25.02.17 esac return 0 ;; esac @@ -147,7 +148,7 @@ shell_help() { shell_help_noarg() { # - # Print help message and return true if args contains -?-h(elp)? or is empty + # Wrapper for shell_help # local msg="" if [ "$#" -gt 0 ]; then @@ -424,12 +425,14 @@ jpg2avi() { cron_d_install() { local usage fname file exp cron tmp test usage="Usage: $FUNCNAME [-t|--test] [CRON_D_FILE] [IGNORE_REGEXP] or [NAME] [CRON_D_CONTENT] [IGNORE_REGEXP]" + #shell_help_noarg "$usage" "$@" && return 1 + #shell_help "$usage" "$@" && return 1 + [ -z "$*" ] && echo "$usage" && return 1 if ! perl -e '' 2>/dev/null; then - echo "cron_d_install: can't run perl" 1>&2 + echo "cron_d_install: please install perl" 1>&2 return 1 fi - shell_help_noarg "$usage" "$@" && return 1 if [ "$#" -gt 0 ]; then case "$1" in -t|--test) test=1; shift ;; esac fi