code: func NewAttachCommand(dockerCli command.Cli) *cobra.Command {
  	var opts attachOptions
  
  	cmd := &cobra.Command{
  		Use:   "attach [OPTIONS] CONTAINER",
  		Short: "Attach local standard input, output, and error streams to a running container",
  		Args:  cli.ExactArgs(1),
  		RunE: func(cmd *cobra.Command, args []string) error {
  			opts.container = args[0]
  			return runAttach(dockerCli, &opts)
  		},
  	}
  
  	flags := cmd.Flags()
  	flags.BoolVar(&opts.noStdin, "no-stdin", false, "Do not attach STDIN")
  	flags.BoolVar(&opts.proxy, "sig-proxy", true, "Proxy all received signals to the process")
  	flags.StringVar(&opts.detachKeys, "detach-keys", "", "Override the key sequence for detaching a container")
  	return cmd
  }
docs: // NewAttachCommand creates a new cobra.Command for `docker attach`