Permalink
Browse files

Check for extra arguments.

  • Loading branch information...
1 parent 718c181 commit 59e7c40ef04adc1bce8bf60c7233af26d80bc52e @AlekSi committed Feb 23, 2013
Showing with 11 additions and 2 deletions.
  1. +1 −0 CHANGELOG
  2. +4 −0 nut/generate.go
  3. +2 −2 nut/main.go
  4. +4 −0 nut/pack.go
View
@@ -7,6 +7,7 @@
+ New API for Nut: FilePath(), ImportPath()
* Fix bug with `nut get` and www.-prefixed hosts.
* Fix some issues on Windows.
+ * Fix -h and extra arguments handling.
- Disallow package names ending with "_".
2012-12-16: 0.2.0
View
@@ -40,6 +40,10 @@ func runGenerate(cmd *Command) {
generateV = config.V
}
+ if len(cmd.Flag.Args()) != 0 {
+ log.Fatal("This command does not accept arguments.")
+ }
+
action := "updated"
var err error
var spec *Spec
View
@@ -19,10 +19,10 @@ type Command struct {
// The first word in the line is taken to be the command name.
UsageLine string
- // Short is the short description shown in the 'nut help' output.
+ // Short is the short description shown in the 'nut help' / ''nut -h' output.
Short string
- // Long is the long message shown in the 'nut help <this-command>' output.
+ // Long is the long message shown in the 'nut help <this-command>' / 'nut <this-command> -h' output.
Long string
// Flag is a set of flags specific to this command.
View
@@ -41,6 +41,10 @@ func runPack(cmd *Command) {
packV = config.V
}
+ if len(cmd.Flag.Args()) != 0 {
+ log.Fatal("This command does not accept arguments.")
+ }
+
/*
packages := build.ImportDir(".", 0)
if len(packages) > 1 {

0 comments on commit 59e7c40

Please sign in to comment.