commands.go 300 B

1234567891011
  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. "exec": cli.CmdExec,
  6. "info": cli.CmdInfo,
  7. "inspect": cli.CmdInspect,
  8. "update": cli.CmdUpdate,
  9. }[name]
  10. }