Skip to content

Commit

Permalink
Adding shitty version of -h
Browse files Browse the repository at this point in the history
  • Loading branch information
winton committed Feb 1, 2012
1 parent 670becf commit 84a6dfc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
3 changes: 1 addition & 2 deletions README.md
Expand Up @@ -123,5 +123,4 @@ Todo
* Add comment on lighthouse with issue URL
* Instead of detecting CONFLICT, use error status $? != 0
* Label issues with ticket milestone?
* gitc LH-ticket should not created a redis record right away, what happens if someone control-c
* gitc -h or gitc help
* gitc LH-ticket should not created a redis record right away, what happens if someone control-c
2 changes: 1 addition & 1 deletion features/gitcycle.feature
Expand Up @@ -8,7 +8,7 @@ Scenario: No command given
Scenario: Non-existent command
When I execute gitcycle with "blah blah"
Then gitcycle runs
And output includes "Command 'blah' not found"
And output includes "Command not recognized."

Scenario: Setup
When I execute gitcycle setup
Expand Down
13 changes: 12 additions & 1 deletion lib/gitcycle.rb
@@ -1,3 +1,5 @@
require 'rubygems'

require 'fileutils'
require 'open-uri'
require 'uri'
Expand Down Expand Up @@ -330,12 +332,14 @@ def start(args=[])
command = args.shift
if command.nil?
puts "\nNo command specified\n".red
elsif command[0..0] == '-'
command_not_recognized
elsif self.respond_to?(command)
send(command, *args)
elsif args.empty?
create_branch(command)
else
puts "\nCommand '#{command}' not found.\n".red
command_not_recognized
end
end

Expand Down Expand Up @@ -431,6 +435,13 @@ def checkout_remote_branch(options={})
run("git push origin #{target}")
end

def command_not_recognized
readme = "https://github.com/winton/gitcycle/blob/master/README.md"
puts "\nCommand not recognized.".red
puts "\nOpening #{readme}\n".green
Launchy.open(readme)
end

def create_pull_request
puts "\nRetrieving branch information from gitcycle.\n".green

Expand Down

0 comments on commit 84a6dfc

Please sign in to comment.