# File lib/teamocil/cli.rb, line 14
    def initialize(argv, env) # {{{
      parse_options! argv
      layout_path = File.join("#{env["HOME"]}", ".teamocil")

      if @options.include?(:list)
        @layouts = get_layouts(layout_path)
        return print_layouts
      end

      file = @options[:layout] || ::File.join(layout_path, "#{argv[0]}.yml")

      if @options[:edit]
        ::FileUtils.touch file unless File.exists?(file)
        Kernel.system("$EDITOR \"#{file}\"")
      elsif @options[:show]
        ::FileUtils.touch file unless File.exists?(file)
        Kernel.system("cat \"#{file}\"")
      else
        bail "There is no file \"#{file}\"" unless File.exists?(file)
        bail "You must be in a tmux session to use teamocil" unless env["TMUX"]

        @layout = Teamocil::Layout.new(YAML.load_file(file), @options)
        @layout.compile!
        @layout.execute_commands(@layout.generate_commands)
      end
    end