Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update documentation.

  • Loading branch information...
commit 3552de127ef29bc29341ef3428ced49dbe6a1a9b 1 parent eb2e998
@AlekSi authored
Showing with 16 additions and 5 deletions.
  1. +9 −1 nut/get.go
  2. +4 −2 nut/get_test.go
  3. +3 −2 nut/install.go
View
10 nut/get.go
@@ -18,7 +18,7 @@ import (
var (
cmdGet = &Command{
Run: runGet,
- UsageLine: "get [-p prefix] [-v] [name or URL]",
+ UsageLine: "get [-p prefix] [-v] [name, import path or URL]",
Short: "download and install nut and dependencies",
}
@@ -29,6 +29,14 @@ var (
func init() {
cmdGet.Long = `
Downloads and installs nut and dependencies from http://gonuts.io/ or specified URL.
+
+Examples:
+ nut install AlekSi/nut
+ nut install AlekSi/nut/0.2.0
+ nut install gonuts.io/AlekSi/nut
+ nut install gonuts.io/AlekSi/nut/0.2.0
+ nut install http://gonuts.io/AlekSi/nut
+ nut install http://gonuts.io/AlekSi/nut/0.2.0
`
cmdGet.Flag.StringVar(&getP, "p", "", "install prefix in workspace, uses hostname if omitted")
View
6 nut/get_test.go
@@ -29,14 +29,16 @@ func (*G) TestArgToURL(c *C) {
// import path style
c.Check(ArgToURL("gonuts.io/AlekSi/test_nut1").String(), Equals, "http://server/AlekSi/test_nut1")
+ c.Check(ArgToURL("gonuts.io/AlekSi/test_nut1/0.0.1").String(), Equals, "http://server/AlekSi/test_nut1/0.0.1")
c.Check(ArgToURL("express42.com/nuts/AlekSi/test_nut1").String(), Equals, "http://express42.com/nuts/AlekSi/test_nut1")
+ c.Check(ArgToURL("express42.com/nuts/AlekSi/test_nut1/0.0.1").String(), Equals, "http://express42.com/nuts/AlekSi/test_nut1/0.0.1")
// full URL - as is
c.Check(ArgToURL("http://www.gonuts.io/AlekSi/test_nut1").String(), Equals, "http://www.gonuts.io/AlekSi/test_nut1")
c.Check(ArgToURL("http://www.gonuts.io/AlekSi/test_nut1/0.0.1").String(), Equals, "http://www.gonuts.io/AlekSi/test_nut1/0.0.1")
c.Check(ArgToURL("http://localhost:8080/AlekSi/test_nut1-0.0.1.nut").String(), Equals, "http://localhost:8080/AlekSi/test_nut1-0.0.1.nut")
- c.Check(ArgToURL("http://express42.com/nuts/AlekSi/test_nut1-0.0.1.nut").String(), Equals, "http://express42.com/nuts/AlekSi/test_nut1-0.0.1.nut")
- c.Check(ArgToURL("https://express42.com/nuts/AlekSi/test_nut1-0.0.1.nut").String(), Equals, "https://express42.com/nuts/AlekSi/test_nut1-0.0.1.nut")
+ c.Check(ArgToURL("http://example.com/nuts/test_nut1-0.0.1.nut").String(), Equals, "http://example.com/nuts/test_nut1-0.0.1.nut")
+ c.Check(ArgToURL("https://example.com/nuts/test_nut1-0.0.1.nut").String(), Equals, "https://example.com/nuts/test_nut1-0.0.1.nut")
}
func (*G) TestNutImports(c *C) {
View
5 nut/install.go
@@ -25,8 +25,9 @@ var (
func init() {
cmdInstall.Long = `
-Copies nuts into GOPATH/nut/<prefix>/<vendor>, unpacks them into
-GOPATH/src/<prefix>/<vendor>/<name>/<version> and installs using 'go install'.
+Copies nuts into GOPATH/nut/<prefix>/<vendor>/<name>-<version>.nut,
+unpacks them into GOPATH/src/<prefix>/<vendor>/<name> and
+installs using 'go install'.
`
cmdInstall.Flag.BoolVar(&installNC, "nc", false, "no check (not recommended)")
Please sign in to comment.
Something went wrong with that request. Please try again.