Permalink
Browse files

Adding dynamic shortcuts

  • Loading branch information...
1 parent 44a664e commit 2d8e9089ec1fb54c6109c6c54775b9bc72ad5c18 @robertodecurnex robertodecurnex committed Aug 20, 2011
Showing with 16 additions and 14 deletions.
  1. +8 −11 README.textile
  2. +6 −1 bin/travis
  3. +2 −2 lib/travis/client.rb
View
@@ -13,8 +13,13 @@ h2. Documentation
h2. Usage [As a Command Line Tool]
<pre>
-Usage
- travis repositories [--recent]
+Supported Commands:
+ travis repositories|repos|repo|r {optios}
+ travis status|stat|s {options}
+
+Repositories:
+ travis status|stat|s
+ travis repositories|repos|repo|r [--recent]
travis repostiories --slugs={repository_slug}[,{repository_slug}[,...]]
travis repositories --name={repository_name} --owner={owner_name}
travis repostiories --slug={repository_slug}
@@ -33,15 +38,7 @@ Supported Options:
-h, -H, --help display this help message.
</pre>
-You can also try:
-
-<pre>
-cd your_travis_hooked_application_path
-
-travis status
-</pre>
-
-This will try to identify and dispaly the status of the target repository based on the current directory remote git urls.
+The `status` command should be run from your project directory. It will try to identify and dispaly the Travis status of the target repository based on the current directory remote git urls.
h2. Usage [As a Ruby Library]
View
@@ -2,8 +2,13 @@
$LOAD_PATH << './lib/'
require 'travis/client'
+available_commands = ['repositories', 'status']
+
command = ARGV.first.to_s.downcase
+if !available_commands.include?(command) && available_commands.select {|c| c =~ Regexp.new("^#{command}.*")}.length == 1
+ command = available_commands.detect {|c| c =~ Regexp.new("^#{command}.*")}
+end
if ['repositories'].include?(command)
Travis::Client.const_get(command.capitalize).new.run
@@ -13,4 +18,4 @@ else
ARGV << '-h'
Travis::Client.new.run
end
-
+
@@ -69,8 +69,8 @@ def setup_help(opts)
opts.separator ''
opts.separator <<-USAGE
Usage:
- travis repositories {options}
- travis status {options}
+ travis repositories|repos|rep|r {options}
+ travis status|stat|s {options}
USAGE
opts.separator ''
opts.separator <<-FURTHER_HELP

0 comments on commit 2d8e908

Please sign in to comment.