Skip to content

Commit 0a03542

Browse files
committed
Merge pull request #120 from oauth-xx/james-refactor-cli
Refactored CLI
2 parents ea8c827 + 1fba802 commit 0a03542

File tree

12 files changed

+758
-365
lines changed

12 files changed

+758
-365
lines changed

bin/oauth

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/usr/bin/env ruby
22

3-
require "oauth/cli"
3+
require_relative "../lib/oauth"
4+
require 'oauth/cli'
45

5-
OAuth::CLI.execute(STDOUT, STDIN, STDERR, ARGV)
6+
Signal.trap("INT") { puts; exit(1) } # don't dump a backtrace on a ^C
7+
8+
ARGV << 'help' if ARGV.empty?
9+
command = ARGV.shift
10+
11+
OAuth::CLI.new(STDOUT, STDIN, STDERR, command, ARGV).run

lib/oauth.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
$LOAD_PATH << File.dirname(__FILE__) unless $LOAD_PATH.include?(File.dirname(__FILE__))
1+
root = File.dirname(__FILE__)
2+
$LOAD_PATH << root unless $LOAD_PATH.include?(root)
23

34
require 'oauth/version'
45

0 commit comments

Comments
 (0)