v2.5.0
===================================================================== --- New Scripts -------------------------- zsh ) vundle-vim helpers - vim/vundle/edit-build-actions - vim/vundle/install - vim/vundle/rebuild quick install-from-source scripts - git/package/install - git/package/build (install --only-build) - git/package/download (install --only-pull) - git/package/update (install --update) config sym-linker (for source-controlled .configs) - config/update (symlinks + terminfo) - config/symlinks (set all symlinks from settings) - config/settings (edit settings which aren't scwrypts env variables) - config/terminfo (load all terminfo from settings) --- Changes ------------------------------ - helper comments are now inserted in all env files - removed underscore prefix for standard AWS environment variables - added "opening" and "finished editing" comments to __EDIT util - added __USAGE to format $USAGE variable to std:err - added __ERROR_CHECK to exit if any __ERROR(s) were called
This commit is contained in:
25
run
25
run
@ -7,27 +7,27 @@ source "$SCWRYPTS_ROOT/zsh/common.zsh" || exit 42
|
||||
|
||||
__RUN() {
|
||||
local USAGE='
|
||||
Usage : scwrypts [OPTIONS ...] SCRIPT -- [SCRIPT OPTIONS ...]
|
||||
usage: scwrypts [OPTIONS ...] SCRIPT -- [SCRIPT OPTIONS ...]
|
||||
|
||||
OPTIONS
|
||||
-e, --env <env-name> set environment; overwrites SCWRYPTS_ENV
|
||||
-n, --no-log skip logging (useful when calling scwrypts as an api)
|
||||
-l, --list print out command list and exit
|
||||
OPTIONS
|
||||
-e, --env <env-name> set environment; overwrites SCWRYPTS_ENV
|
||||
-n, --no-log skip logging (useful when calling scwrypts as an api)
|
||||
-l, --list print out command list and exit
|
||||
|
||||
-h, --help display this message and exit
|
||||
'
|
||||
-h, --help display this message and exit
|
||||
'
|
||||
cd "$SCWRYPTS_ROOT"
|
||||
|
||||
local ENV_NAME="$SCWRYPTS_ENV"
|
||||
local SEARCH_PATTERNS=()
|
||||
|
||||
local ARGS_ERROR=0
|
||||
local ERROR=0
|
||||
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
case $1 in
|
||||
-h | --help )
|
||||
echo $USAGE
|
||||
__USAGE
|
||||
return 0
|
||||
;;
|
||||
-n | --no-log )
|
||||
@ -50,7 +50,6 @@ OPTIONS
|
||||
;;
|
||||
-* )
|
||||
__ERROR "unrecognized argument '$1'"
|
||||
((ARGS_ERROR+=1))
|
||||
shift 1
|
||||
;;
|
||||
* )
|
||||
@ -60,15 +59,13 @@ OPTIONS
|
||||
esac
|
||||
done
|
||||
|
||||
[[ $ARGS_ERROR -gt 0 ]] && {
|
||||
echo $USAGE
|
||||
return 1
|
||||
}
|
||||
__ERROR_CHECK
|
||||
|
||||
##########################################
|
||||
|
||||
local SCRIPT=$(__SELECT_SCRIPT $SEARCH_PATTERNS)
|
||||
[ ! $SCRIPT ] && exit 2
|
||||
export SCWRYPT_NAME=$SCRIPT
|
||||
|
||||
local ENV_REQUIRED=$(__CHECK_ENV_REQUIRED && echo 1 || echo 0)
|
||||
|
||||
|
Reference in New Issue
Block a user