Skip to content

Commit

Permalink
Merge pull request #73 from iron-io/fix-code-name-for-register-command
Browse files Browse the repository at this point in the history
fix -name arg for register command (issue #72)
  • Loading branch information
Reed Allman committed Jun 6, 2016
2 parents 92ecb6b + 7c438dd commit e7b823f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -656,10 +656,14 @@ func (u *RegisterCmd) Args() error {
u.codes.Command = strings.TrimSpace(strings.Join(u.flags.Args()[1:], " "))
u.codes.Image = u.flags.Arg(0)

u.codes.Name = u.codes.Image
if strings.ContainsRune(u.codes.Name, ':') {
arr := strings.SplitN(u.codes.Name, ":", 2)
u.codes.Name = arr[0]
if u.name != nil && *u.name != "" {
u.codes.Name = *u.name
} else {
u.codes.Name = u.codes.Image
if strings.ContainsRune(u.codes.Name, ':') {
arr := strings.SplitN(u.codes.Name, ":", 2)
u.codes.Name = arr[0]
}
}

u.codes.MaxConcurrency = *u.maxConc
Expand Down

0 comments on commit e7b823f

Please sign in to comment.