Skip to content

Commit

Permalink
#22 --version, fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Yegor Bugayenko committed Dec 2, 2014
1 parent 49b5b6c commit dde6957
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bin/pdd
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ require 'nokogiri'
opts = Slop.parse(ARGV, strict: true, help: true) do
banner "Usage (#{PDD::VERSION}): pdd [options]"
on 'v', 'verbose', 'Enable verbose mode'
on 'version', 'Show current version'
on 's', 'source', 'Source directory to parse', argument: :required
on 'f', 'file', 'File to save XML into', argument: :required
on 'e', 'exclude', 'Glob pattern to exclude', as: Array, argument: :required
Expand All @@ -45,6 +46,11 @@ if opts.help?
exit
end

if opts.version?
puts PDD::VERSION
exit
end

Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
file = opts.file? ? File.new(opts[:file], 'w') : STDOUT
Expand Down

0 comments on commit dde6957

Please sign in to comment.