-function _manual_stash_help() {
- # instruct user how to create bash_enter or bash_leave
- if [[ -n $VARSTASH_AUTOEDIT || -n $VARSTASH_AUTOCONFIG ]]; then
- if [[ -z $VARSTASH_QUIET ]]; then
- echo "varstash: Automatically running $help_cmd"
- fi
-
- if [[ ! -d $help_dir ]]; then
- mkdir -p "$help_dir"
- fi
- eval $help_cmd
-
- if [[ -n $VARSTASH_AUTOEDIT ]]; then
- varstash_edit $help_which
- fi
- elif [[ -z $VARSTASH_QUIET ]]; then
- echo "############################################################################"
- echo "# You are manually $help_action. To automatically perform this"
- echo "# whenever you enter this directory, paste the following command(s):"
-
- if [[ ! -d $help_dir ]]; then
- echo "mkdir -p \"$help_dir\""
- fi
- echo "$help_cmd"
- echo "############################################################################"
- fi
-}
-
-# A couple convenient aliases for smartcd_edit
-function autostash_edit() {
- varstash_edit "$@"
-}
-
-function varstash_edit() {
- local file="$1"
- local dir="$2"
-
- if [[ -n $ZSH_VERSION ]]; then
- if [[ $(type smartcd_edit) == "smartcd_edit is a shell function" ]]; then
- local can_run=1
- fi
- else
- if [[ $(type -t smartcd_edit) == "function" ]]; then
- local can_run=1
- fi
- fi
-
- if [[ -n "$can_run" ]]; then
- # XXX - no support for "--host" or "--system" with this (yet?)
- _smartcd_file_check "$file" "global" "" edit "$dir"
- else
- echo "smartcd not loaded, cannot run smartcd_edit"
- fi
-}
-
-# Run deferred smartcd if we're waiting for it, and arrays is also loaded
-if [[ -n "$smartcd_initially_deferred" && -n "$(fn_exists apush)" && -z "$SMARTCD_NOINITIAL" ]]; then
- smartcd_skip_action=1
- smartcd_run_mainline=1
- smartcd cd
- unset smartcd_skip_action
- unset smartcd_initially_deferred
-fi
-