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