diff --git a/bin/git-cleanup b/bin/git-cleanup index 45c109a..4e293c8 100755 --- a/bin/git-cleanup +++ b/bin/git-cleanup @@ -15,6 +15,10 @@ opts = OptionParser.new do |opts| opts.on("-s", "--skip-unmerged", "Unmerge branches will be skipped") do |u| conf[:skip_unmerged] = true end + opts.on("-v", "--version", "Shows version") do + puts GitCleanup::VERSION + exit + end opts.on("-h", "--help", "Shows this help") do puts opts exit diff --git a/git-cleanup.gemspec b/git-cleanup.gemspec index 9d110c7..742a4e3 100644 --- a/git-cleanup.gemspec +++ b/git-cleanup.gemspec @@ -1,9 +1,10 @@ # -*- encoding: utf-8 -*- $:.push File.expand_path("../lib", __FILE__) +require "git-cleanup/version" Gem::Specification.new do |s| s.name = "git-cleanup" - s.version = "0.1.3" + s.version = GitCleanup::VERSION s.platform = Gem::Platform::RUBY s.authors = ["Martyn Loughran"] s.email = ["me@mloughran.com"] diff --git a/lib/git-cleanup.rb b/lib/git-cleanup.rb index a1397fe..50b4653 100644 --- a/lib/git-cleanup.rb +++ b/lib/git-cleanup.rb @@ -94,3 +94,4 @@ def self.prune(repo) require 'git-cleanup/branch' require 'git-cleanup/helper' +require 'git-cleanup/version' diff --git a/lib/git-cleanup/version.rb b/lib/git-cleanup/version.rb new file mode 100644 index 0000000..d72257b --- /dev/null +++ b/lib/git-cleanup/version.rb @@ -0,0 +1,3 @@ +class GitCleanup + VERSION = "0.1.3" +end