mirror of
https://github.com/wahyd4/gvm.git
synced 2026-08-10 05:16:13 +10:00
44 lines
805 B
Bash
Executable File
44 lines
805 B
Bash
Executable File
#!/bin/bash
|
|
. $GVM_ROOT/scripts/functions
|
|
|
|
function show_usage() {
|
|
echo "Usage: gvm listall [options]"
|
|
echo " -a, --all List all tags."
|
|
echo " -h, --help Display this message."
|
|
}
|
|
|
|
function read_command_line() {
|
|
tag_filter="release"
|
|
for i in $*; do
|
|
case $i in
|
|
-a|--all)
|
|
tag_filter=""
|
|
;;
|
|
-h|--help*)
|
|
show_usage
|
|
exit 0
|
|
;;
|
|
*)
|
|
echo "Invalid option $i"
|
|
show_usage
|
|
exit 65 # Bad arguments
|
|
;;
|
|
esac
|
|
done
|
|
}
|
|
|
|
read_command_line $@
|
|
|
|
echo
|
|
display_message "gvm gos (available)"
|
|
echo
|
|
versions=`curl -s https://go.googlecode.com/hg/.hgtags | awk '{ print $2 }' | grep "$tag_filter" | sort`
|
|
if [[ $? -ne 0 ]]; then
|
|
display_error "Failed to get version list from Google"
|
|
fi
|
|
for version in $versions; do
|
|
echo " $version"
|
|
done
|
|
echo
|
|
|