Sha256: 8925700feef909ea13ed2fd4d280acb0bc54a45169f30edf1c2ce6faf81ea14a

Contents?: true

Size: 680 Bytes

Versions: 1

Compression:

Stored size: 680 Bytes

Contents

#!/usr/bin/env ruby
require 'syntax_fix'
require 'optparse'

checker = SyntaxFix::Checker.new
optparse = OptionParser.new do |opts|
  opts.on( '-h', '--help', 'Display this screen' ) do
    puts opts
    exit
  end
  opts.on( '-v', '--verbose', 'Be verbose about the actions' ) do
    checker.verbose = true
  end
  opts.on( '-p [PATH or FILENAME]', '--path [PATH or FILENAME]', 'Specify the relative path to start actions from or a single file' ) do |path|
    checker.rel_path = path
  end
  checker.rel_path ||= '.'
end
optparse.parse!

puts 'Reading files...' if checker.verbose
path = File.expand_path(checker.rel_path)
checker.fix_code(path)
puts 'Done!' if checker.verbose

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
syntax_fix-0.0.4 bin/syntax_fix