class MiGA::Cli::Action::Edit

Public Instance Methods

parse_cli() click to toggle source
# File lib/miga/cli/action/edit.rb, line 8
def parse_cli
  cli.parse do |opt|
    cli.opt_object(opt, [:project, :dataset_opt])
    opt.on(
      '-m', '--metadata STRING',
      'Metadata as key-value pairs separated by = and delimited by comma',
      'Values are saved as strings except for booleans (true / false) or nil'
      ){ |v| cli[:metadata] = v }
  end
end
perform() click to toggle source
# File lib/miga/cli/action/edit.rb, line 19
def perform
  obj = cli.load_project_or_dataset
  cli.add_metadata(obj)
  obj.save
end