Skip to content

Commit

Permalink
to 0.2.7; fixed files/args not recognized
Browse files Browse the repository at this point in the history
  • Loading branch information
hedzr committed May 23, 2019
1 parent 70adbdd commit 82325df
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const (
// AppName const
AppName = "cmdr" // main app-name
// Version const
Version = "0.2.5" // version name
Version = "0.2.7" // version name
// VersionInt const
VersionInt = 0x000205 // using as
VersionInt = 0x000207 // using as
)
6 changes: 6 additions & 0 deletions exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ func InternalExecFor(rootCmd *RootCommand, args []string) (err error) {
}
}
} else {
if goCommand.Action != nil && len(goCommand.SubCommands) == 0 {
// the args remained are files, not sub-commands.
pkg.i--
break
}

ferr("Unknown command: %v", pkg.a)
pkg.unknownCmds = append(pkg.unknownCmds, pkg.a)
}
Expand Down

0 comments on commit 82325df

Please sign in to comment.