From 317fcdbfe78724f099687f173b6d608bc8a28f1a Mon Sep 17 00:00:00 2001 From: Yamashita Yuu Date: Thu, 31 Jan 2013 12:23:17 +0900 Subject: [PATCH] add rbenv 0.4.x style documentation --- bin/pyenv-virtualenv | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/bin/pyenv-virtualenv b/bin/pyenv-virtualenv index ff7d522..df1f2a1 100755 --- a/bin/pyenv-virtualenv +++ b/bin/pyenv-virtualenv @@ -1,10 +1,17 @@ #!/usr/bin/env bash +# +# Summary: Create a Python virtualenv using the python-virtualenv plugin +# +# Usage: pyenv virtualenv [-v|--verbose] [VIRTUALENV_OPTIONS] +# +# -v/--verbose Verbose mode: print compilation status to stdout +# set -e [ -n "$PYENV_DEBUG" ] && set -x # Provide pyenv completions if [ "$1" = "--complete" ]; then - exec pyenv versions --bare + exec pyenv-versions --bare fi if [ -z "$PYENV_ROOT" ]; then @@ -15,12 +22,8 @@ fi eval "$(python-virtualenv --lib)" usage() { - { echo "usage: pyenv virtualenv [-v|--verbose] [VIRTUALENV_OPTIONS] VERSION VIRTUALENV_NAME" - echo - echo " -v/--verbose Verbose mode: print compilation status to stdout" - echo - } >&2 - + # We can remove the sed fallback once pyenv 0.4.0 is widely available. + pyenv-help virtualenv 2>/dev/null || sed -ne '/^#/!q;s/.//;s/.//;1,4d;p' < "$0" [ -z "$1" ] || exit "$1" }