add auth scopes
[arvados.git] / sdk / cli / bin / arv
index 052aecb8fa2fd75b497c71966ace327f217b56b4..209ae5cc44cfac93623405581a83ef66c9f87227 100755 (executable)
@@ -10,6 +10,35 @@ if RUBY_VERSION < '1.9.3' then
   EOS
 end
 
+if ARGV[0] == 'keep'
+  ARGV.shift
+  @sub = ARGV.shift
+  if ['ls', 'get', 'put', 'less', 'check'].index @sub then
+    exec `which wh#{@sub}`.strip, *ARGV
+  else
+    puts "Usage: \n" +
+      "#{$0} keep ls\n" +
+      "#{$0} keep get\n" +
+      "#{$0} keep put\n" +
+      "#{$0} keep less\n" +
+      "#{$0} keep check\n"
+  end
+  abort
+end
+
+if ARGV[0] == 'pipeline'
+  ARGV.shift
+  @sub = ARGV.shift
+  if ['run'].index @sub then
+    exec `which arv-run-pipeline-instance`.strip, *ARGV
+  else
+    puts "Usage: \n" +
+      "#{$0} pipeline run [...]\n" +
+      "(see arv-run-pipeline-instance --help for details)\n"
+  end
+  abort
+end
+
 ENV['ARVADOS_API_VERSION'] ||= 'v1'
 
 if not ENV.include?('ARVADOS_API_HOST') or not ENV.include?('ARVADOS_API_TOKEN') then
@@ -109,7 +138,7 @@ def parse_arguments(discovery_document)
         discovered_params.each do |k,v|
           opts = Hash.new()
           opts[:type] = v["type"].to_sym if v.include?("type")
-          if [:datetime, :text, :object].index opts[:type]
+          if [:datetime, :text, :object, :array].index opts[:type]
             opts[:type] = :string                       # else trollop bork
           end
           opts[:default] = v["default"] if v.include?("default")
@@ -122,7 +151,7 @@ def parse_arguments(discovery_document)
         end
       end
       discovered_params.each do |k,v|
-        if v["type"] == "object" and method_opts.has_key? k
+        if ['object', 'array'].index(v["type"]) and method_opts.has_key? k
           method_opts[k] = JSON.parse method_opts[k]
         end
       end