end
-subcommands = %w(copy create edit keep pipeline run tag view ws)
+subcommands = %w(copy create edit get keep pipeline run tag ws)
def exec_bin bin, opts
- @bin_path = `which #{bin}`.strip
- if @bin_path.empty?
+ bin_path = `which #{bin}`.strip
+ if bin_path.empty?
raise "#{bin}: command not found"
end
- exec @bin_path, *opts
+ exec bin_path, *opts
end
def check_subcommands client, arvados, subcommand, global_opts, remaining_opts
arv_create client, arvados, global_opts, remaining_opts
when 'edit'
arv_edit client, arvados, global_opts, remaining_opts
- when 'view'
- arv_view client, arvados, global_opts, remaining_opts
+ when 'get'
+ arv_get client, arvados, global_opts, remaining_opts
when 'copy', 'tag', 'ws', 'run'
exec_bin "arv-#{subcommand}", remaining_opts
when 'keep'
Oj.load(newcontent)
when 'yaml'
YAML.load(newcontent)
+ else
+ abort "Unrecognized format #{global_opts[:format]}"
end
yield newobj
exit 0
end
-def arv_view client, arvados, global_opts, remaining_opts
+def arv_get client, arvados, global_opts, remaining_opts
uuid = remaining_opts.shift
if uuid.nil? or uuid == "-h" or uuid == "--help"
puts head_banner
- puts "Usage: arv view [uuid] [fields...]\n\n"
+ puts "Usage: arv get [uuid] [fields...]\n\n"
puts "Fetch the specified Arvados object, select the specified fields, \n"
puts "and print a text representation (json or yaml, use --format).\n"
exit 255