Sha256: 6e3f5834e57dc051b09539044e5e6a28c6cc45883ee43f97e80deb16a09cd1c3

Contents?: true

Size: 837 Bytes

Versions: 40

Compression:

Stored size: 837 Bytes

Contents

class Eco::API::UseCases::Default::Locations::TagtreeUpload
  # Class to define the CLI integration of a usecase anywhere it suits.
  class Cli < Eco::API::UseCases::Cli
    desc "Uploads the tagtree (assumes nodes don't exist!)"

    callback do |_sess, options, _case|
      file = SCR.get_file(cli_name, required: true, should_exist: true)
      options.deep_merge!(source: {file: file})
    end

    add_option("-top-id", "To nest the upload under some existing node (i.e. top node)") do |options|
      format = SCR.get_arg("-top-id", with_param: true)
      options.deep_merge!(input: {top_id: format})
    end

    add_option("-structure-id", "Target structure id") do |options|
      id = SCR.get_arg("-structure-id", with_param: true)
      options.deep_merge!(source: {structure_id: id})
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
eco-helpers-3.0.21 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-3.0.20 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-3.0.19 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-3.0.18 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-3.0.17 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-3.0.16 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-3.0.15 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-3.0.14 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-3.0.13 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-3.0.12 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-3.0.11 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-3.0.10 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-3.0.9 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-3.0.8 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-3.0.7 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-3.0.6 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-3.0.5 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-3.0.4 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-3.0.3 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-3.0.2 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb