lib/eco/cli/config/default/usecases.rb in eco-helpers-2.0.14 vs lib/eco/cli/config/default/usecases.rb in eco-helpers-2.0.15
- old
+ new
@@ -1,7 +1,13 @@
ASSETS.cli.config do |cnf|
cnf.usecases do |cases|
+ desc = "Draws the Supervisors hiearchy in a file (use option -to file.ext)"
+ cases.add("-supers-hierarchy", :export, desc, case_name: "supers-hierarchy") do |people, session, options|
+ file = (SCR.get_arg("-to") && SCR.get_file("-to", required: true, should_exist: false)) || "supers_hierarchy.txt"
+ options.deep_merge!(output: {file: file})
+ end
+
desc = "It exports to a CSV the (filtered) people"
cases.add("-people-to-csv", :export, desc) do |people, session, options|
file = SCR.get_file("-people-to-csv", required: true, should_exist: false)
options.deep_merge!(export: {file: {name: file, format: :csv}})
options.deep_merge!(export: {options: {nice_header: true}}) if SCR.get_arg("-nice-header")