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: cli.rb
    path of file: ./repos/flipper/lib/flipper
    
    the code of the file until where you have to start completion: require 'optparse'

module Flipper
  class CLI < OptionParser
    def self.run(argv = ARGV)
      new.run(argv)
    end

    # Path to the local Rails application's environment configuration.
    DEFAULT_REQUIRE = "./config/environment"

    attr_accessor :shell

    def initialize(stdout: $stdout, stderr: $stderr, shell: Bundler::Thor::Base.shell.new)
      super

      # Program is always flipper, no matter how it's invoked
      @program_name = 'flipper'
      @require = ENV.fetch("FLIPPER_REQUIRE", DEFAULT_REQUIRE)
      @commands = {}

      # Extend whatever shell to support output redirection
      @shell = shell.extend(ShellOutput)
      shell.redirect(stdout: stdout, stderr: stderr)

      %w[enable disable].each do |action|
        command action do |c|
          c.banner = "Usage: #{c.program_name} [options] <feature>"
          c.description = "#{action.to_s.capitalize} a feature"

          values = []

          c.on('-a id', '--actor=id', "#{action} for an actor") do |id|
            values << Actor.new(id)
          end
          c.on('-g name', '--group=name', "#{action} for a group") do |name|
            values << Types::Group.new(name)
          end
          c.on('-p NUM', '--percentage-of-actors=NUM', Numeric, "#{action} for a percentage of actors") do |num|
            values << Types::PercentageOfActors.new(num)
          end
          c.on('-t NU
    
    def initialize(stdout: $stdout, stderr: $stderr, shell: Bundler::Thor::Base.shell.new)
      super

      # Program is always flipper, no matter how it's invoked
      @program_name = 'flipper'
      @require = ENV.fetch("FLIPPER_REQUIRE", DEFAULT_REQUIRE)
      @commands = {}

      # Extend whatever shell to support output redirection
      @shell = shell.extend(ShellOutput)
      shell.redirect(stdout: stdout, stderr: stderr)

      %w[enable disable].each do |action|
        command action do |c|
          c.banner = "Usage: #{c.program_name} [options] <feature>"
          c.description = "#{action.to_s.capitalize} a feature"

          values = []

          c.on('-a id', '--actor=id', "#{action} for an actor") do |id|
            values << Actor.new(id)
          end
          c.on('-g name', '--group=name', "#{action} for a group") do |name|
            values << Types::Group.new(name)
          end
          c.on('-p NUM', '--percentage-of-actors=NUM', Numeric, "#{action} for a percentage of actors") do |num|
            values << Types::PercentageOfActors.new(num)
          end
          c.on('-t NUM', '--percentage-of-time=NUM', Numeric, "#{action} for a percentage of time") do |num|
            values << Types::PercentageOfTime.new(num)
          end
          c.on('-x expressions', '--expression=NUM', "#{action} for the given expression") do |expression|
            begin
              values << Flipper::Expression.build(JSON.parse(expression))
            rescue JSON::ParserError => e
              ui.error "JSON parse error #{e.message}"
              ui.trace(e)
              exit 1
            rescue ArgumentError => e
              ui.error "Invalid expression: #{e.message}"
              ui.trace(e)
              exit 1
            end
          end

          c.action do |feature|
            f = Flipper.feature(feature)

            if values.empty?
              f.send(action)
            else
              values.each { |value| f.send(action, value) }
            end

            ui.info feature_details(f)
          end
        end