You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: pull_command.rb
    path of file: ./repos/kontena/cli/lib/kontena/cli/stacks/registry
    
    the code of the file until where you have to start completion: require_relative '../common'

module Kontena::Cli::Stacks::Registry
  class PullCommand < Kontena::Command
    include Kontena::Cli::Common
    include Kontena:
    
    def execute
      target = no_cache? ? stacks_client : Kontena::StacksCache
      content = target.pull(stack_name)
      if return?
        return content
      elsif file
        File.write(file, content)
        puts pastel.green("Wrote #{content.bytesize} bytes to #{file}")
      else
        puts content
      end