diff --git a/bin/pdd b/bin/pdd index f161b87..ee5dcc1 100755 --- a/bin/pdd +++ b/bin/pdd @@ -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 @@ -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