lib/eco/cli_default/options.rb in eco-helpers-3.0.4 vs lib/eco/cli_default/options.rb in eco-helpers-3.0.5
- old
+ new
@@ -5,22 +5,26 @@
active = proc do |opt|
if (there = SCR.get_arg(opt))
refine = SCR.get_arg(opt, with_param: true)
end
+
refine || there
end
if (hpf = active.call("-filters"))
puts conf.people_filters.help(refine: hpf)
end
+
if (hif = active.call("-input-filters"))
puts conf.input_filters.help(refine: hif)
end
+
if (ho = active.call("-options"))
puts conf.options_set.help(refine: ho)
end
+
if (huc = active.call("-usecases"))
puts conf.usecases.help(refine: huc)
end
puts [
@@ -62,16 +66,16 @@
sch_name = SCR.get_arg("-schema-id", with_param: true)
sch_id = session.schemas.to_id(sch_name)
unless sch_id
msg = "You need to specify a correct schema id or name. '#{sch_name}' does not exist"
- session.logger.error(msg)
+ session.log(:error) { msg }
exit(1)
end
-
options.deep_merge!(people: {filter: {details: {schema_id: sch_id}}})
- session.logger.info("Setting schema #{session.schemas.to_name(sch_id)}")
-
+ session.log(:info) {
+ "Setting schema #{session.schemas.to_name(sch_id)}"
+ }
session.schema = sch_id
end
desc = "Used to be used to specify the input file or folder when using -get-partial. "
desc << "It can also be useful to obtain `-get-partial` of people base on `:export` use cases (i.e. -people-to-csv)"