commands.go 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. "attach": cli.CmdAttach,
  6. "build": cli.CmdBuild,
  7. "commit": cli.CmdCommit,
  8. "cp": cli.CmdCp,
  9. "create": cli.CmdCreate,
  10. "diff": cli.CmdDiff,
  11. "events": cli.CmdEvents,
  12. "exec": cli.CmdExec,
  13. "export": cli.CmdExport,
  14. "history": cli.CmdHistory,
  15. "images": cli.CmdImages,
  16. "import": cli.CmdImport,
  17. "info": cli.CmdInfo,
  18. "inspect": cli.CmdInspect,
  19. "kill": cli.CmdKill,
  20. "load": cli.CmdLoad,
  21. "login": cli.CmdLogin,
  22. "logout": cli.CmdLogout,
  23. "logs": cli.CmdLogs,
  24. "network": cli.CmdNetwork,
  25. "network create": cli.CmdNetworkCreate,
  26. "network connect": cli.CmdNetworkConnect,
  27. "network disconnect": cli.CmdNetworkDisconnect,
  28. "network inspect": cli.CmdNetworkInspect,
  29. "network ls": cli.CmdNetworkLs,
  30. "network rm": cli.CmdNetworkRm,
  31. "pause": cli.CmdPause,
  32. "port": cli.CmdPort,
  33. "ps": cli.CmdPs,
  34. "pull": cli.CmdPull,
  35. "push": cli.CmdPush,
  36. "rename": cli.CmdRename,
  37. "restart": cli.CmdRestart,
  38. "rm": cli.CmdRm,
  39. "rmi": cli.CmdRmi,
  40. "run": cli.CmdRun,
  41. "save": cli.CmdSave,
  42. "search": cli.CmdSearch,
  43. "start": cli.CmdStart,
  44. "stats": cli.CmdStats,
  45. "stop": cli.CmdStop,
  46. "tag": cli.CmdTag,
  47. "top": cli.CmdTop,
  48. "unpause": cli.CmdUnpause,
  49. "update": cli.CmdUpdate,
  50. "version": cli.CmdVersion,
  51. "volume": cli.CmdVolume,
  52. "volume create": cli.CmdVolumeCreate,
  53. "volume inspect": cli.CmdVolumeInspect,
  54. "volume ls": cli.CmdVolumeLs,
  55. "volume rm": cli.CmdVolumeRm,
  56. "wait": cli.CmdWait,
  57. }[name]
  58. }