code: func (c *cipdSubcommand) done(result interface{}, err error) int {
  	err = c.writeJSONOutput(result, err)
  	if err != nil {
  		c.printError(err)
  		return 1
  	}
  	return 0
  }
docs: // done is called as a last step of processing a subcommand. It dumps command
  // result (or error) to JSON output file, prints error message and generates
  // process exit code.