<commit_before>ARGV << '--help' if ARGV.empty?

aliases = {
    'ds' => 'domainserver',
    's' => 'server',
    'ps' => 'projectionserver',
    'g' => 'generate',
    '-h' => '--help',
    '-v' => '--version',
}

help_message = <<-EOT
Usage: disco COMMAND [ARGS]

The most common disco commands are:
 generate(g)           Generate new Rails Disco code
 domainserver(ds)      Start the domain server
 projectionserver(ps)  Start the projection server
 server(s)             Start domain and projection server
 new                   Creates a new Rails Disco application
                       "disco new my_app" creates a
                       new application called MyApp in "./my_app"

In addition to those, there are:
 application           Generate the Rails Disco application code
 destroy(d)            Undo code generated with "generate"

All commands can be run with -h (or --help) for more information.
EOT


command = ARGV.shift
command = aliases[command] || command

case command
  when 'generate', 'destroy'
    require 'disco/generators'

    require APP_PATH
    Rails.application.require_environment!
    Rails.application.load_generators

    require "disco/commands/#{command}"

  when 'server', 'domainserver', 'projectionserver'
    Dir.chdir(File.expand_path('../../', APP_PATH)) unless File.exists?(File.expand_path('config.ru'))

    require "disco/commands/#{command}"

  when 'new'
    if %w(-h --help).include?(ARGV.first)
      require 'disco/commands/application'
    else
      puts "Can't initialize a new Rails Disco application within the directory of another, please change to a non-Rails Disco directory first.\n"
      puts "Type 'disco' for help."
      exit(1)
    end

  when '--version'
    require 'rails-disco/version'
    puts "Rails Disco #{RailsDisco::VERSION::STRING}"

  when '--help'
    puts help_message

  else
    puts "Error: Command '#{command}' not recognized"
    puts help_message
    exit(1)
end
<commit_msg>disco d as shortcut for destroy<commit_after>ARGV << '--help' if ARGV.empty?

aliases = {
    'ds' => 'domainserver',
    's' => 'server',
    'ps' => 'projectionserver',
    'g' => 'generate',
    'd' => 'destroy',
    '-h' => '--help',
    '-v' => '--version',
}

help_message = <<-EOT
Usage: disco COMMAND [ARGS]

The most common disco commands are:
 generate(g)           Generate new Rails Disco code
 domainserver(ds)      Start the domain server
 projectionserver(ps)  Start the projection server
 server(s)             Start domain and projection server
 new                   Creates a new Rails Disco application
                       "disco new my_app" creates a
                       new application called MyApp in "./my_app"

In addition to those, there are:
 application           Generate the Rails Disco application code
 destroy(d)            Undo code generated with "generate"

All commands can be run with -h (or --help) for more information.
EOT


command = ARGV.shift
command = aliases[command] || command

case command
  when 'generate', 'destroy'
    require 'disco/generators'

    require APP_PATH
    Rails.application.require_environment!
    Rails.application.load_generators

    require "disco/commands/#{command}"

  when 'server', 'domainserver', 'projectionserver'
    Dir.chdir(File.expand_path('../../', APP_PATH)) unless File.exists?(File.expand_path('config.ru'))

    require "disco/commands/#{command}"

  when 'new'
    if %w(-h --help).include?(ARGV.first)
      require 'disco/commands/application'
    else
      puts "Can't initialize a new Rails Disco application within the directory of another, please change to a non-Rails Disco directory first.\n"
      puts "Type 'disco' for help."
      exit(1)
    end

  when '--version'
    require 'rails-disco/version'
    puts "Rails Disco #{RailsDisco::VERSION::STRING}"

  when '--help'
    puts help_message

  else
    puts "Error: Command '#{command}' not recognized"
    puts help_message
    exit(1)
end

{'fraction_non_alphanumeric': 0.11505538771399798, 'fraction_numerical': 0.0010070493454179255, 'mean_word_length': 2.801913875598086, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 16, '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': '4315441', 'n_tokens_mistral': 1197, 'n_tokens_neox': 1166, 'n_words': 383}