Merge pull request #33 from modcloth-labs/filling-in-linkthis-docs

Filling in some docs for the `linkthis` command
This commit is contained in:
jbussdieker
2013-08-05 11:49:35 -07:00
4 changed files with 19 additions and 7 deletions
+1
View File
@@ -10,6 +10,7 @@ Features
* Manage GOPATHs with `gvm pkgset [create/use/delete] [name]`. Use `--local` as `name` to manage repository under local path (`/path/to/repo/.gvm_local`).
* List latest release tags with `gvm listall`. Use `--all` to list weekly as well.
* Cache a clean copy of the latest Go source for multiple version installs.
* Link project directories into GOPATH
Background
==========
+1
View File
@@ -10,6 +10,7 @@ Features
* Manage GOPATHs with `gvm pkgset [create/use/delete] [name]`. Use `--local` as `name` to manage repository under local path (`/path/to/repo/.gvm_local`).
* List latest release tags with `gvm listall`. Use `--all` to list weekly as well.
* Cache a clean copy of the latest Go source for multiple version installs.
* Link project directories into GOPATH
Background
==========
+1
View File
@@ -46,6 +46,7 @@ Commands:
install - install go versions
uninstall - uninstall go versions
cross - install go cross compilers
linkthis - link this directory into GOPATH
list - list installed go versions
listall - list available versions
alias - manage go version aliases
+16 -7
View File
@@ -2,12 +2,18 @@
. $GVM_ROOT/scripts/functions
function show_usage() {
echo "Usage: gvm linkthis <package-name> [options]"
echo " -h, --help Display this message."
echo "Usage: gvm linkthis [package-name] [options]"
echo " -h, --help Display this message."
echo
echo "If the [package-name] is provided, it will be used in the path based"
echo "at \${GOPATH%%:*}/src, e.g.:"
echo
echo " gvm linkthis github.com/moovweb/gpkg"
echo
echo "If omitted, the [package-name] will be the basename of the current"
echo "directory, e.g. '$package_name_basename'."
}
package_name="$(basename "$PWD")"
function read_command_line() {
for i in $*; do
case $i in
@@ -20,13 +26,16 @@ function read_command_line() {
show_usage
exit 65 # Bad arguments
;;
*)
package_name="$i"
;;
*)
package_name="$i"
;;
esac
done
}
package_name="$(basename "$PWD")"
package_name_basename="$package_name"
read_command_line "$@"
target="${GOPATH%%:*}/src/$package_name"