#!/bin/sh usage() { cat <<-EOF Usage: repo-cros [dir] [command opts] Commands: int switch to internal tree ext switch to external tree -b switch branches EOF exit ${1:-1} } [[ $# -eq 0 ]] && usage vexec() { cd ${DIR:-~/chromiumos} printf '%s\n%s\n' "${PWD}" "$*" exec "$@" } DIR= while [[ $# -gt 0 ]] ; do case $1 in int) vexec repo init -u ssh://gerrit-int.chromium.org:29419/chromeos/manifest-internal.git --repo-url='http://git.chromium.org/external/repo.git' ;; ext) vexec repo init -u http://git.chromium.org/chromiumos/manifest.git --repo-url http://git.chromium.org/external/repo.git ;; -b) vexec repo init -b $2 ;; *) if [[ -z ${DIR} ]] ; then DIR=$1 else usage fi ;; esac shift done exit 0