Skip to content

Commit e7b823f

Browse files
author
Reed Allman
committed
Merge pull request #73 from iron-io/fix-code-name-for-register-command
fix -name arg for register command (issue #72)
2 parents 92ecb6b + 7c438dd commit e7b823f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

commands.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -656,10 +656,14 @@ func (u *RegisterCmd) Args() error {
656656
u.codes.Command = strings.TrimSpace(strings.Join(u.flags.Args()[1:], " "))
657657
u.codes.Image = u.flags.Arg(0)
658658

659-
u.codes.Name = u.codes.Image
660-
if strings.ContainsRune(u.codes.Name, ':') {
661-
arr := strings.SplitN(u.codes.Name, ":", 2)
662-
u.codes.Name = arr[0]
659+
if u.name != nil && *u.name != "" {
660+
u.codes.Name = *u.name
661+
} else {
662+
u.codes.Name = u.codes.Image
663+
if strings.ContainsRune(u.codes.Name, ':') {
664+
arr := strings.SplitN(u.codes.Name, ":", 2)
665+
u.codes.Name = arr[0]
666+
}
663667
}
664668

665669
u.codes.MaxConcurrency = *u.maxConc

0 commit comments

Comments
 (0)