You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
750 B
Plaintext
46 lines
750 B
Plaintext
11 years ago
|
#!/usr/bin/env bash
|
||
|
|
||
|
. "$GVM_ROOT/scripts/functions"
|
||
|
|
||
|
function show_usage() {
|
||
|
echo "Usage: gvm pkgenv [packageset-name]"
|
||
|
echo
|
||
|
echo " -h, --help Display this message."
|
||
|
echo " -o, --output Write content to stdout"
|
||
|
echo
|
||
|
echo "The [packageset-name] is optional."
|
||
|
echo
|
||
|
}
|
||
|
|
||
|
for i in "$@"; do
|
||
|
case $i in
|
||
|
-h|--help*)
|
||
|
show_usage
|
||
|
exit 0
|
||
|
;;
|
||
|
-o|--output*)
|
||
|
output=true
|
||
|
;;
|
||
|
*)
|
||
|
gvm_env="$i"
|
||
|
;;
|
||
|
esac
|
||
|
done
|
||
|
|
||
|
if [ -z "$gvm_go_name" ]; then
|
||
|
display_fatal "current go version not managed by gvm"
|
||
|
fi
|
||
|
|
||
|
if [ ! -z "$gvm_env" ]; then
|
||
|
gvm_env="@$gvm_env"
|
||
|
fi
|
||
|
|
||
|
env_file=$GVM_ROOT/environments/$gvm_go_name$gvm_env
|
||
|
|
||
|
if [ $output ]; then
|
||
|
cat "$env_file"
|
||
|
exit 0
|
||
|
fi
|
||
|
|
||
|
${EDITOR:-vi} "$env_file"
|