Skip to content

Commit d7add8d

Browse files
committed
Finish 2.2.8
2 parents 350df1f + 5f1d075 commit d7add8d

File tree

7 files changed

+491
-263
lines changed

7 files changed

+491
-263
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.2.7
1+
2.2.8

bin/rdf

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,24 @@ $:.unshift(File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib')))
33
require 'rubygems'
44
require 'rdf/cli'
55

6-
options = RDF::CLI.options do
7-
self.on('-v', '--verbose', 'Enable verbose output. May be given more than once.') do
8-
self.options[:logger].level = Logger::INFO
9-
end
6+
options = RDF::CLI.options(ARGV)
107

11-
self.on('-V', '--version', 'Display the RDF.rb version and exit.') do
12-
puts RDF::VERSION; exit
13-
end
8+
abort options.banner if ARGV.empty? && !options.options[:evaluate]
9+
10+
# Add option_parser to parsed options to enable help
11+
begin
12+
messages = {}
13+
RDF::CLI.exec(options.args, option_parser: options, **options.options.merge(messages: messages))
1414

15-
ARGV.select {|a| RDF::CLI.commands.include?(a)}.each do |cmd|
16-
# Load command-specific options
17-
Array(RDF::CLI::COMMANDS[cmd.to_sym][:options]).each do |cli_opt|
18-
on_args = cli_opt.on || []
19-
on_args << cli_opt.description if cli_opt.description
20-
self.on(*on_args) do |arg|
21-
self.options[cli_opt.symbol] = cli_opt.call(arg)
15+
unless messages.empty?
16+
$stdout.puts "Messages:"
17+
messages.each do |kind, term_messages|
18+
term_messages.each do |term, messages|
19+
$stdout.puts "#{kind} #{term}"
20+
messages.each {|m| $stdout.puts " #{m}"}
2221
end
2322
end
2423
end
24+
rescue ArgumentError => e
25+
RDF::CLI.abort e.message
2526
end
26-
27-
abort options.banner if ARGV.empty? && !options.options[:evaluate]
28-
29-
# Add option_parser to parsed options to enable help
30-
RDF::CLI.exec(ARGV, options.options.merge(option_parser: options))

0 commit comments

Comments
 (0)