Files
gvm/scripts/pkgenv
T
Ali Abbas 7d722aee3f * Switch $* to $@
* Use double quote everywhere, to avoid potential future globbing or word splitting
* Beautify EDITOR eval
* Fix typo in gvm-installer
* bin double quotes - best practice to avoid potential shell globbing and word splitting
* properly reference variable label
* simplify gvm-installer
2014-04-05 10:13:57 +02:00

46 lines
750 B
Bash
Executable File

#!/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"