#! /usr/local/bin/ruby18
require 'ruby_toggle_file'
require 'optparse'

USAGE = <<XXX
Usage: ruby-toggle-file RUBY_SCRIPT

I (ruby-toggle-file) accept one Ruby script filename and prints
corresponding file.  If RUBY_SCRIPT is implementation script
(library), then returns test script and vice versa.  It is recommended
that implementation scripts are located in lib/ directory and test
scripts are located in test/ directory. This command supports Ruby on
Rails file layout.

I infer corresponding file if it does not exist.

If you are curious about behavior, see test/test_ruby_toggle_file.rb.

I am meant to be used in text editors or IDEs.
XXX

ARGV.options {|o|
  o.banner = USAGE
  o.parse!
}
print RubyToggleFile.new.ruby_toggle_file(ARGV.first)
