Skip to content

Commit

Permalink
Add command line option to print version
Browse files Browse the repository at this point in the history
  • Loading branch information
mloughran committed Apr 12, 2012
1 parent bf134b3 commit 5de7a65
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions bin/git-cleanup
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion 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"]
Expand Down
1 change: 1 addition & 0 deletions lib/git-cleanup.rb
Expand Up @@ -94,3 +94,4 @@ def self.prune(repo)

require 'git-cleanup/branch'
require 'git-cleanup/helper'
require 'git-cleanup/version'
3 changes: 3 additions & 0 deletions lib/git-cleanup/version.rb
@@ -0,0 +1,3 @@
class GitCleanup
VERSION = "0.1.3"
end

0 comments on commit 5de7a65

Please sign in to comment.