class Eco::API::UseCases::Default::Utils::SplitCsv class Cli < Eco::API::UseCases::Cli desc "Splits an input file into multiple ones" 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("-max-rows", "The max count of rows of the output files") do |options| count = SCR.get_arg("-max-rows", with_param: true) options.deep_merge!(output: {file: {max_rows: count}}) end add_option("-start-at", "Get only the last N-start_at rows") do |options| count = SCR.get_arg("-start-at", with_param: true) options.deep_merge!(output: {file: {start_at: count}}) end end end