OPAM_EXECUTABLE_PATH=$(which opam) || return 1
function opam () {    
    "$OPAM_EXECUTABLE_PATH" "$@"
    if [ -n "$1" ] && [ "$1" = "switch" ]
    then
        eval $("$OPAM_EXECUTABLE_PATH" config -env)
    fi
} 

function opam-switch-eval () {
    opam switch "$@" --no-warning
    eval $(opam config env)
}

Define the shell 'opam-switch-eval' function to switch and eval
Define the shell 'opam-switch-eval' function to switch and eval
