lib/travis/cli/repo_command.rb in travis-1.8.14.travis.1156.9 vs lib/travis/cli/repo_command.rb in travis-1.8.14.travis.1160.9
- old
+ new
@@ -4,10 +4,13 @@
module Travis
module CLI
class RepoCommand < ApiCommand
GIT_REGEX = %r{/?(.*/.+?)(\.git)?$}
TRAVIS = %r{^https://(staging-)?api\.travis-ci\.(org|com)}
- on('-r', '--repo SLUG', 'repository to use (will try to detect from current git clone)') { |c, slug| c.slug = slug }
+ on('-r', '--repo SLUG', 'repository to use (will try to detect from current git clone)') do |c, slug|
+ c.slug = slug
+ c.error "SLUG should be of the form OWNER/REPO" unless slug.split('/').compact.size == 2
+ end
on('-R', '--store-repo SLUG', 'like --repo, but remembers value for current directory') do |c, slug|
c.slug = slug
c.send(:store_slug, slug)
end