moby/graph/tag.go
Shishir Mahajan 573cd092a5 cleanup of docker tag command code
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
2015-01-26 09:15:32 -05:00

19 lines
443 B
Go

package graph
import (
"github.com/docker/docker/engine"
)
func (s *TagStore) CmdTag(job *engine.Job) engine.Status {
if len(job.Args) != 2 && len(job.Args) != 3 {
return job.Errorf("Usage: %s IMAGE REPOSITORY [TAG]\n", job.Name)
}
var tag string
if len(job.Args) == 3 {
tag = job.Args[2]
}
if err := s.Set(job.Args[1], tag, job.Args[0], job.GetenvBool("force")); err != nil {
return job.Error(err)
}
return engine.StatusOK
}