Permalink
Browse files

Removing BASH functionality, we are now fully engaged with ZSH.

  • Loading branch information...
wayneeseguin committed Sep 20, 2011
1 parent 2693c73 commit f82623f0ed53c61b5f94853b36d0d1b8c022482f
Showing with 9 additions and 42 deletions.
  1. +4 −1 core/api/shell/package/functions
  2. +1 −7 core/sm/shell/core/cli
  3. +4 −30 core/sm/shell/log/functions
  4. +0 −4 core/sm/shell/log/initialize
@@ -86,7 +86,10 @@ package()
shift
;;
(*)
- __sm.log.fail "Unknown configure param '$1'."
+ if [[ -n "$1" ]]
+ then
+ __sm.log.fail "Unknown configure param '$1'."
+ fi
continue
;;
esac
View
@@ -94,13 +94,7 @@ then
extension_args=()
fi
-if [[ -n "${BASH_VERSION}" ]]
-then
- PS4="# \${BASH_SOURCE##\${sm_path}\/} \${FUNCNAME[0]:+\${FUNCNAME[0]}()} \${LINENO} $ "
-elif [[ -n "${ZSH_VERSION}" ]]
-then
- PS4="+%x:%I %N():%i > "
-fi
+PS4="+%x:%I %N():%i > "
export PS4
if [[ " ${trace_flags} " =~ " all " ]]
@@ -337,15 +337,7 @@ __sm.log.todo()
__sm.log.error()
{
- set +o xtrace
- if [[ -n "${BASH_VERSION}" ]]
- then
- printf "ERROR(${FUNCNAME[2]}): $*\n" >&2
- set +o errtrace
- elif [[ -n "${ZSH_VERSION}" ]]
- then
- printf "ERROR(${funcstack[3]}): $*\n" >&2
- fi
+ printf "ERROR(${funcstack[3]}): $*\n" >&2
trap - ERR
exit 1
}
@@ -364,13 +356,7 @@ __sm.log.fail()
{
trace_filter log || set -o xtrace
trace_flag=0
- if [[ -n "${BASH_VERSION}" ]]
- then
- backtrace "FAIL(${funcname[2]}): $*"
- elif [[ -n "${ZSH_VERSION}" ]]
- then
- backtrace "FAIL(${funcstack[3]}): $*"
- fi
+ backtrace "FAIL(${funcstack[3]}): $*"
exit 1
}
@@ -380,13 +366,7 @@ __sm.set.ps4()
# Set and export the PS4 variable, so that this script -- and called bash scripts --
# will display more detailed and formatted trace output.
# Finally, return true, 0, for success.
- if [[ -n "${BASH_VERSION}" ]]
- then
- PS4="# \${BASH_SOURCE##\${sm_path}\/} \${FUNCNAME[0]:+\${FUNCNAME[0]}()} \${LINENO} $ "
- elif [[ -n "${ZSH_VERSION}" ]]
- then
- PS4="+%x:%I %N():%i > "
- fi
+ PS4="+%x:%I %N():%i > "
export PS4
return 0
@@ -468,13 +448,7 @@ __sm.debug.variables.callback()
trace_filter log || set -o xtrace
typeset _variable ction_stack
- if [[ -n "${BASH_VERSION}" ]]
- then
- _stack="${FUNCNAME[*]}"
- elif [[ -n "${ZSH_VERSION}" ]]
- then
- _stack="${funcstack[*]}"
- fi
+ _stack="${funcstack[*]}"
for _variable in ${var_debug_flags[@]}
do
@@ -22,10 +22,6 @@ then set -e; else set -o errtrace ; fi
# Call backtrace on error
trap "backtrace \"A command has returned error code '(\$?)' without being handled.\"" ERR
-if [[ -n "${BASH_VERSION}" ]] # Persist function RETURN & DEBUG handler
-then set -o functrace ; fi
-# Do not set trap ... RETURN here, set it on first -x
-
if [[ -n "${var_debug_flags[*]}" ]]
then
__sm.debug.variables.callback.initialize

0 comments on commit f82623f

Please sign in to comment.