Sha256: 891e3eb5003fd2c32e77d0eae275136d561072b77d999b0ba633274aa4460a39

Contents?: true

Size: 551 Bytes

Versions: 3

Compression:

Stored size: 551 Bytes

Contents

class Eco::API::UseCases::Default::Utils::SortCsv
  class Cli < Eco::API::UseCases::Cli
    desc 'Sorts the CSV by column -by'

    callback do |_session, options, _usecase|
      if (file = SCR.get_file(cli_name, required: true, should_exist: true))
        options.deep_merge!(input: {file: file})
      end
    end

    add_option('-by', 'The column that should be used to sorting') do |options|
      if (file = SCR.get_arg("-by", with_param: true))
        options.deep_merge!(input: {sort_by: file})
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
eco-helpers-3.0.21 lib/eco/api/usecases/default/utils/cli/sort_csv_cli.rb
eco-helpers-3.0.20 lib/eco/api/usecases/default/utils/cli/sort_csv_cli.rb
eco-helpers-3.0.19 lib/eco/api/usecases/default/utils/cli/sort_csv_cli.rb