Sha256: 84f005c8347ff5e1a64c82b8b4e00d2d253e8ee93bb0f805d6a2d2f1de75cd32
Contents?: true
Size: 767 Bytes
Versions: 2
Compression:
Stored size: 767 Bytes
Contents
#!/usr/bin/env ruby require_relative '../lib/hsql/command_line' command_line = HSQL::CommandLine.new options = command_line.options filename = command_line.filename unless filename puts command_line.option_parser exit 1 end begin file = File.new(filename) rescue Errno::ENOENT puts "#{filename.inspect}: No such file" exit 1 end require_relative '../lib/hsql' file = HSQL::File.parse_file(file, options) if 'yaml' == options[:meta_only] puts file.to_yaml elsif 'json' == options[:meta_only] puts file.to_json else # Runs the whole SQL string through the parser to find the individual queries # and then deparses it file.queries.each do |query| puts '-- Parsed and deparsed SQL:' if command_line.options[:verbose] puts query end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
hsql-0.3.6 | bin/hsql |
hsql-0.3.5 | bin/hsql |