Permalink
Browse files

Add command line option to print version

  • Loading branch information...
1 parent bf134b3 commit 5de7a65f4721a0731aaed8d76c892cf8ccd75f8c @mloughran committed Apr 12, 2012
Showing with 10 additions and 1 deletion.
  1. +4 −0 bin/git-cleanup
  2. +2 −1 git-cleanup.gemspec
  3. +1 −0 lib/git-cleanup.rb
  4. +3 −0 lib/git-cleanup/version.rb
View
@@ -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
View
@@ -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"]
View
@@ -94,3 +94,4 @@ def self.prune(repo)
require 'git-cleanup/branch'
require 'git-cleanup/helper'
+require 'git-cleanup/version'
@@ -0,0 +1,3 @@
+class GitCleanup
+ VERSION = "0.1.3"
+end

0 comments on commit 5de7a65

Please sign in to comment.