commands.go 483 B

123456789101112131415161718
  1. package client
  2. // Command returns a cli command handler if one exists
  3. func (cli *DockerCli) Command(name string) func(...string) error {
  4. return map[string]func(...string) error{
  5. "commit": cli.CmdCommit,
  6. "cp": cli.CmdCp,
  7. "exec": cli.CmdExec,
  8. "info": cli.CmdInfo,
  9. "inspect": cli.CmdInspect,
  10. "login": cli.CmdLogin,
  11. "logout": cli.CmdLogout,
  12. "ps": cli.CmdPs,
  13. "pull": cli.CmdPull,
  14. "push": cli.CmdPush,
  15. "update": cli.CmdUpdate,
  16. }[name]
  17. }