class MiGA::Cli::Action::Rm

Public Instance Methods

parse_cli() click to toggle source
# File lib/miga/cli/action/rm.rb, line 8
def parse_cli
  cli.defaults = {remove: false}
  cli.parse do |opt|
    cli.opt_object(opt)
    opt.on(
      '-r', '--remove',
      'Also remove all associated files',
      'By default, only unlinks from metadata'
      ){ |v| cli[:remove] = v }
  end
end
perform() click to toggle source
# File lib/miga/cli/action/rm.rb, line 20
def perform
  d = cli.load_dataset
  cli.load_project.unlink_dataset(d.name)
  d.remove! if cli[:remove]
end