Permalink
Browse files

lib/wadl/cli.rb: Some more help wrt WADL and PATH.

  • Loading branch information...
1 parent 0c032e7 commit 432d0c8b21ebd3c17e8d5ef8d3f9b7a41bc74289 @blackwinter committed Aug 11, 2010
Showing with 7 additions and 3 deletions.
  1. +1 −0 TODO
  2. +6 −3 lib/wadl/cli.rb
View
1 TODO
@@ -1 +1,2 @@
* WADL formatters (plain text, HTML?)
+* Caching of downloaded WADL file
View
@@ -82,7 +82,7 @@ def execute(arguments = [], *inouterr)
parse_arguments(arguments)
abort USAGE if resource_path.empty?
- abort 'WADL required' unless options[:wadl]
+ abort "WADL location is required! (Specify with '--wadl' or see '--help')" unless options[:wadl]
options[:wadl] %= options[:base_url] if options[:base_url]
response = auth_resource.send(options[:method].downcase, :query => opts)
@@ -97,7 +97,7 @@ def api
def resource
@resource ||= begin
- path = [options[:api_base], *resource_path].compact.join(' ')
+ path = [options[:api_base], *resource_path].compact.join('/')
path.split(RESOURCE_PATH_RE).inject(api) { |m, n| m.send(n) }
end
end
@@ -232,7 +232,7 @@ def option_parser(defaults)
opts.separator ''
- opts.on('-w', '--wadl FILE_OR_URL', "Path or URL to WADL file") { |wadl|
+ opts.on('-w', '--wadl FILE_OR_URL', "Path or URL to WADL file [Required]") { |wadl|
options[:wadl] = wadl
}
@@ -320,6 +320,9 @@ def option_parser(defaults)
opts.on('-D', '--dump-config', "Dump config and exit") {
options[:dump_config] = true
}
+
+ opts.separator ''
+ opts.separator "PATH may be separated by any of #{RESOURCE_PATH_RE.source}."
}
end

0 comments on commit 432d0c8

Please sign in to comment.