lib/eco/cli_default/options.rb in eco-helpers-2.7.4 vs lib/eco/cli_default/options.rb in eco-helpers-2.7.12

- old
+ new

@@ -1,10 +1,10 @@ -ASSETS.cli.config do |cnf| - cnf.options_set do |options_set, options| - options_set.add("--help", "Offers a HELP") do |options, sesssion| +ASSETS.cli.config do |cnf| # rubocop:disable Metrics/BlockLength + cnf.options_set do |options_set, options| # rubocop:disable Metrics/BlockLength + options_set.add("--help", "Offers a HELP") do |options, session| conf = ASSETS.cli.config - active = Proc.new do |opt| + active = proc do |opt| if there = SCR.get_arg(opt) refine = SCR.get_arg(opt, with_param: true) end refine || there end @@ -35,11 +35,11 @@ end desc = "Redirect Standard Ouput to file" options_set.add("-stdout", desc) do |options, session| file = SCR.get_arg("-stdout", with_param: true) || "output.txt" - STDOUT.reopen(file, "w+") + $stdout.reopen(file, "w+") end desc = "Skips the check of the headers" options_set.add("-skip-header-check", desc) do |options, session| options.deep_merge!(input: {header_check: {skip: true}}) @@ -123,18 +123,18 @@ options_set.add("-processed-people-to-csv", desc) do |options, session| file = SCR.get_file("-processed-people-to-csv", required: true, should_exist: false) options.deep_merge!(report: {people: {csv: file}}) end - desc = "Runs in dry-run (no requests sent to server)" + 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" + 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). " @@ -177,9 +177,14 @@ desc = "Search mode that will try to find people using email when id and external_id have failed" desc += " This option could identify existing people by their email addresses" desc += " (it should not be used in orgs where multiple people usually have the same email address)" options_set.add("-search-soft", desc) do |options| options.deep_merge!(search: {soft: true, strict: false}) + end + + desc = "Prevent email to be sent (experimental)" + options_set.add("-no-email", desc) do |options| + options.deep_merge!(workflow: {no_email: true}) end desc = "Silence notifications on account creation or invites" options_set.add(["-no-invites", "-exclude-invites"], desc) do |options| options.merge!(send_invites: false)