#!/usr/bin/env zsh # # Set up for CPython development. # # Eryn Wells function _usage-setup-cpython { cat <&2 return -1 ;; esac done if [[ ! -d "$root" ]]; then print_error "Invalid source root: $root" return 1 fi export coverage export lib="$root/Lib" export root function cov { local cmd case "$1" in (html) local module="$root/Lib/$2" if [[ ! -d "$module" ]]; then if [[ -f "$module.py" ]]; then module="$module.py" fi fi cmd="html -i --include=$module" ;; (report) cmd="report" ;; (run) cmd="run --pylib --source=$2 Lib/test/regrtest.py test_$2" ;; esac (cd "$root"; ./python.exe "$coverage" "$cmd") } unsetup_functions=(unsetup-cpython) } function unsetup-cpython { unset coverage unset lib unset root unfunction cov } setup-cpython "$@"