lib/eco/cli/config/default/options.rb in eco-helpers-2.0.25 vs lib/eco/cli/config/default/options.rb in eco-helpers-2.0.26
- old
+ new
@@ -1,21 +1,32 @@
ASSETS.cli.config do |cnf|
cnf.options_set do |options_set, options|
options_set.add("--help", "Offers a HELP") do |options, sesssion|
- conf = ASSETS.cli.config
- puts conf.people_filters.help if hpf = SCR.get_arg("-filters")
- puts conf.input_filters.help if hif = SCR.get_arg("-input-filters")
- puts conf.options_set.help if ho = SCR.get_arg("-options")
- puts conf.usecases.help if huc = SCR.get_arg("-usecases")
+ conf = ASSETS.cli.config
+ active = Proc.new {|opt| SCR.get_arg(opt) && SCR.get_arg(opt, with_param: true)}
+
+ 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 [
"Please specify one of the below:",
" -filters to display available filters on people",
" -input-filters to display available filters on input data",
" -options to dislpay available options",
" -usecases to display available usecases",
- "",
- "You may specify the usecase to know its specific options by: -usecase_name --help -options"
+ "TIPS:",
+ " * You may specify the usecase to know its specific options by: -usecase_name --help -options",
+ " * You may specify a refinement to show specific information only: --help -usecases tags"
].join("\n") unless hpf || hif || ho || huc
exit
end
desc = "Redirect Standard Ouput to file"
@@ -83,9 +94,14 @@
desc = "Runs in dry-run (no requests sent to server)"
options_set.add(["-dry-run", "-simulate"], desc) do |options, session|
options[:dry_run] = true
options[:simulate] = true
session.config.dry_run!
+ end
+
+ desc = "Runs runs post_launch cases even if in dry-run"
+ options_set.add("-run-postlaunch", desc) do |options, session|
+ options.deep_merge!(post_launch: {run: true})
end
desc = "(careful with this option) This will include everybody as part of the update (including those that are api excluded). "
desc += "Only launch with this option when only api excluded people are included in your update."
options_set.add("-include-excluded", desc) do |options|