<commit_before>require 'optparse'

module Bitcache::CLI
  class Base
    @@cmd = nil

    def self.inherited(child) #:nodoc:
      at_exit { child.new(ARGV).send(:run) }
    end

    def self.banner(text)
      @@opts ||= OptionParser.new
      @@opts.banner = text
    end

    def self.option(*args)
      @@opts ||= OptionParser.new
      block = args.pop
      @@opts.on(*args, &block)
    end

    def self.help(command, text)
      @@help ||= {}
      @@help[command] = text
    end

    help :help, "Display a list of all supported commands."

    def help(command = nil)
      puts @@opts.to_s
      puts
      @@help.each do |cmd, text|
        if command.nil? || command == cmd.to_s
          puts "    #{cmd.to_s.ljust(32)} #{text}"
        end
      end<commit_msg>Minor formatting improvement for help screen.<commit_after>require 'optparse'

module Bitcache::CLI
  class Base
    @@cmd = nil

    def self.inherited(child) #:nodoc:
      at_exit { child.new(ARGV).send(:run) }
    end

    def self.banner(text)
      @@opts ||= OptionParser.new
      @@opts.banner = text
    end

    def self.option(*args)
      @@opts ||= OptionParser.new
      block = args.pop
      @@opts.on(*args, &block)
    end

    def self.help(command, text)
      @@help ||= {}
      @@help[command] = text
    end

    help :help, "Display a list of all supported commands."

    def help(command = nil)
      puts @@opts.to_s
      puts "\nCommands:" unless !command.nil? || @@help.empty?
      @@help.each do |cmd, text|
        if command.nil? || command == cmd.to_s
          puts "    #{cmd.to_s.ljust(32)} #{text}"
        end
      end
      puts
{'fraction_non_alphanumeric': 0.14190418435415403, 'fraction_numerical': 0.002425712553062462, 'mean_word_length': 2.160919540229885, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3277797', 'n_tokens_mistral': 578, 'n_tokens_neox': 553, 'n_words': 139}