projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
7204: Minor refactoring of methods supporting `arv get` test cases.
[arvados.git]
/
sdk
/
cli
/
bin
/
arv
diff --git
a/sdk/cli/bin/arv
b/sdk/cli/bin/arv
index cf1e732d19bf05a6291f7ecde3c6c46ed5790496..ccdd8a8c12bc077295f336be97c1f96d30cbfb3a 100755
(executable)
--- a/
sdk/cli/bin/arv
+++ b/
sdk/cli/bin/arv
@@
-85,14
+85,14
@@
def init_config
end
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
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
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
end
def check_subcommands client, arvados, subcommand, global_opts, remaining_opts
@@
-101,8
+101,8
@@
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
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'
when 'copy', 'tag', 'ws', 'run'
exec_bin "arv-#{subcommand}", remaining_opts
when 'keep'
@@
-185,6
+185,8
@@
def edit_and_commit_object initial_obj, tmp_stem, global_opts, &block
Oj.load(newcontent)
when 'yaml'
YAML.load(newcontent)
Oj.load(newcontent)
when 'yaml'
YAML.load(newcontent)
+ else
+ abort "Unrecognized format #{global_opts[:format]}"
end
yield newobj
end
yield newobj
@@
-343,11
+345,11
@@
def arv_edit client, arvados, global_opts, remaining_opts
exit 0
end
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
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
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