Skip to content

Commit

Permalink
Add a version constant and print it with --version.
Browse files Browse the repository at this point in the history
  • Loading branch information
alloy committed Sep 17, 2011
1 parent 21e4cd3 commit 478c140
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cocoapods.gemspec
@@ -1,8 +1,9 @@
# -*- encoding: utf-8 -*-
require File.expand_path('../lib/cocoapods', __FILE__)

Gem::Specification.new do |s|
s.name = "cocoapods"
s.version = "0.0.1"
s.version = Pod::VERSION
s.date = "2011-09-17"
s.license = "MIT"
s.summary = "A simple Objective-C library package manager."
Expand Down
2 changes: 2 additions & 0 deletions lib/cocoapods.rb
@@ -1,4 +1,6 @@
module Pod
VERSION = '0.0.1'

class Informative < StandardError
end

Expand Down
5 changes: 4 additions & 1 deletion lib/cocoapods/command.rb
Expand Up @@ -40,7 +40,8 @@ def self.banner
def self.options
" --help Show help information\n" \
" --silent Print nothing\n" \
" --verbose Print more information while working"
" --verbose Print more information while working\n" \
" --version Prints the version of CocoaPods"
end

def self.run(*argv)
Expand All @@ -58,6 +59,8 @@ def self.run(*argv)

def self.parse(*argv)
argv = ARGV.new(argv)
raise Informative, VERSION if argv.option('--version')

show_help = argv.option('--help')
Config.instance.silent = argv.option('--silent')
Config.instance.verbose = argv.option('--verbose')
Expand Down

0 comments on commit 478c140

Please sign in to comment.