1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--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
}