class MiGA::Cli::Action::AddResult

Public Instance Methods

parse_cli() click to toggle source
# File lib/miga/cli/action/add_result.rb, line 8
def parse_cli
  cli.defaults = {force: false}
  cli.parse do |opt|
    cli.opt_object(opt, [:project, :dataset_opt, :result])
    opt.on(
      '-f', '--force',
      'Force re-indexing of the result even if it\s already registered'
      ){ |v| cli[:force] = v }
  end
end
perform() click to toggle source
# File lib/miga/cli/action/add_result.rb, line 19
def perform
  cli.ensure_par(result: '-r')
  obj = cli.load_project_or_dataset
  cli.say "Registering result: #{cli[:result]}"
  r = obj.add_result(cli[:result], true, force: cli[:force])
  raise "Cannot add result, incomplete expected files." if r.nil?
end