def run(args)
      run_option_parser(args)

      case @options[:command]
      when 'list'
        load_rewriters
        list_available_rewriters
      when 'open'
        open_rewriter
      when 'query'
        load_rewriters
        query_available_rewriters
      when 'show'
        load_rewriters
        show_rewriter
      when 'sync'
        sync_snippets
      else
        load_rewriters
        @options[:snippet_names].each do |snippet_name|
          puts "===== #{snippet_name} started ====="
          group, name = snippet_name.split('/')
          rewriter = Core::Rewriter.call group, name
          rewriter.warnings.each do |warning|
            puts '[Warn] ' + warning.message
          end
          puts rewriter.todo if rewriter.todo
          puts "===== #{snippet_name} done ====="
        end
      end
      true
    rescue SystemExit
      true
    rescue Parser::SyntaxError => e
      puts "Syntax error: #{e.message}"
      puts "file #{e.diagnostic.location.source_buffer.name}"
      puts "line #{e.diagnostic.location.line}"
      false
    rescue Synvert::Core::RewriterNotFound => e
      puts e.message
      false
    end
def run(args)
      run_option_parser(args)

      case @options[:command]
      when 'list'
        load_rewriters
        list_available_rewriters
      when 'open'
        open_rewriter
      when 'query'
        load_rewriters
        query_available_rewriters
      when 'show'
        load_rewriters
        show_rewriter
      when 'sync'
        sync_snippets
      else
        load_rewriters
        @options[:snippet_names].each do |snippet_name|
          puts "===== #{snippet_name} started ====="
          group, name = snippet_name.split('/')
          rewriter = Core::Rewriter.call group, name
          rewriter.warnings.each do |warning|
            puts '[Warn] ' + warning.message
          end
          puts rewriter.todo if rewriter.todo
          puts "===== #{snippet_name} done ====="
        end
      end
      true
    rescue SystemExit
      true
    rescue Parser::SyntaxError => e
      puts "Syntax error: #{e.message}"
      puts "file #{e.diagnostic.location.source_buffer.name}"
      puts "line #{e.diagnostic.location.line}"
      false
    rescue Synvert::Core::RewriterNotFound => e
      puts e.message
      false
    end
Initialize a CLI.
 Run the CLI.
 @param args [Array] arguments.
 @return [Boolean] true if command runs successfully.