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.1 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-3.0.0 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-2.7.25 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-2.7.24 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-2.7.23 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-2.7.22 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-2.7.21 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-2.7.20 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-2.7.19 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-2.7.18 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-2.7.17 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-2.7.16 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-2.7.15 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-2.7.14 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-2.7.13 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-2.7.12 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-2.7.4 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-2.7.2 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-2.7.1 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb
eco-helpers-2.7.0 lib/eco/api/usecases/default/locations/cli/tagtree_upload_cli.rb