Permalink
Browse files

Add usage examples.

  • Loading branch information...
1 parent 81fc699 commit d56099f4a57ff7be8df25d77732bc5f485765d6f @AlekSi committed Feb 17, 2013
Showing with 38 additions and 17 deletions.
  1. +1 −1 nut/base.go
  2. +6 −1 nut/check.go
  3. +4 −1 nut/generate.go
  4. +9 −9 nut/get.go
  5. +5 −1 nut/install.go
  6. +4 −1 nut/pack.go
  7. +5 −2 nut/publish.go
  8. +4 −1 nut/unpack.go
View
@@ -40,7 +40,7 @@ var (
NutImportPrefixes = map[string]string{"gonuts.io": "www.gonuts.io"}
config Config
- vHelp string = fmt.Sprintf("be verbose, may be read from ~/%s", ConfigFileName)
+ vHelp string = fmt.Sprintf("be verbose (may be read from ~/%s)", ConfigFileName)
)
func init() {
View
@@ -23,7 +23,12 @@ func init() {
cmdCheck.Long = `
Checks given spec (.json) or nut (.nut) files.
If no filenames are given, checks spec nut.json in current directory.
- `
+
+Examples:
+ nut check
+ nut check test_nut1/nut.json
+ nut check test_nut1/test_nut1-0.0.1.nut
+`
cmdCheck.Flag.BoolVar(&checkV, "v", false, vHelp)
}
View
@@ -27,7 +27,10 @@ var (
func init() {
cmdGenerate.Long = `
Generates or updates spec nut.json for package in current directory.
- `
+
+Examples:
+ nut generate
+`
cmdGenerate.Flag.BoolVar(&generateV, "v", false, vHelp)
}
View
@@ -31,15 +31,15 @@ func init() {
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")
+ 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 from URL if omitted")
cmdGet.Flag.BoolVar(&getV, "v", false, vHelp)
}
View
@@ -28,7 +28,11 @@ func init() {
Copies nuts into GOPATH/nut/<prefix>/<vendor>/<name>-<version>.nut,
unpacks them into GOPATH/src/<prefix>/<vendor>/<name> and
installs using 'go install'.
- `
+
+Examples:
+ nut install test_nut1-0.0.1.nut
+ nut install -p gonuts.io test_nut1-0.0.1.nut
+`
cmdInstall.Flag.BoolVar(&installNC, "nc", false, "no check (not recommended)")
cmdInstall.Flag.StringVar(&installP, "p", "localhost", "install prefix in workspace")
View
@@ -26,7 +26,10 @@ var (
func init() {
cmdPack.Long = `
Packs package in current directory into nut.
- `
+
+Examples:
+ nut pack
+`
cmdPack.Flag.BoolVar(&packNC, "nc", false, "no check (not recommended)")
cmdPack.Flag.StringVar(&packO, "o", "", "output filename")
View
@@ -24,9 +24,12 @@ var (
func init() {
cmdPublish.Long = `
Publishes nut on http://gonuts.io/ (requires registration with Google account).
- `
- tokenHelp := fmt.Sprintf("access token (see http://gonuts.io/-/me), may be read from ~/%s", ConfigFileName)
+Examples:
+ nut publish test_nut1-0.0.1.nut
+`
+
+ tokenHelp := fmt.Sprintf("access token from http://gonuts.io/-/me (may be read from ~/%s)", ConfigFileName)
cmdPublish.Flag.StringVar(&publishToken, "token", "", tokenHelp)
cmdPublish.Flag.BoolVar(&publishV, "v", false, vHelp)
}
View
@@ -19,7 +19,10 @@ var (
func init() {
cmdUnpack.Long = `
Unpacks nut into current directory.
- `
+
+Examples:
+ nut unpack test_nut1-0.0.1.nut
+`
cmdUnpack.Flag.BoolVar(&unpackNC, "nc", false, "no check (not recommended)")
cmdUnpack.Flag.BoolVar(&unpackV, "v", false, vHelp)

0 comments on commit d56099f

Please sign in to comment.