commands.go 535 B

1234567891011121314151617181920
  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. "load": cli.CmdLoad,
  11. "login": cli.CmdLogin,
  12. "logout": cli.CmdLogout,
  13. "ps": cli.CmdPs,
  14. "pull": cli.CmdPull,
  15. "push": cli.CmdPush,
  16. "save": cli.CmdSave,
  17. "update": cli.CmdUpdate,
  18. }[name]
  19. }