Merge branch 'master' of github.com:xyproto/cli into xyproto-master
Conflicts: app.go context.go
This commit is contained in:
11
command.go
11
command.go
@@ -43,15 +43,16 @@ func (c Command) Run(ctx *Context) error {
|
||||
|
||||
var err error
|
||||
if firstFlagIndex > -1 {
|
||||
args := ctx.Args()[1:firstFlagIndex]
|
||||
flags := ctx.Args()[firstFlagIndex:]
|
||||
err = set.Parse(append(flags, args...))
|
||||
args := ctx.Args()
|
||||
regularArgs := args[1:firstFlagIndex]
|
||||
flagArgs := args[firstFlagIndex:]
|
||||
err = set.Parse(append(flagArgs, regularArgs...))
|
||||
} else {
|
||||
err = set.Parse(ctx.Args()[1:])
|
||||
err = set.Parse(ctx.Args().Tail())
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
fmt.Println("Incorrect Usage.\n")
|
||||
fmt.Printf("Incorrect Usage.\n\n")
|
||||
ShowCommandHelp(ctx, c.Name)
|
||||
fmt.Println("")
|
||||
return err
|
||||
|
Reference in New Issue
Block a user