lib/i18n/tasks/command/commands/tree.rb in i18n-tasks-0.9.12 vs lib/i18n/tasks/command/commands/tree.rb in i18n-tasks-0.9.13

- old
+ new

@@ -1,6 +1,7 @@ # frozen_string_literal: true + module I18n::Tasks module Command module Commands module Tree include Command::Collection @@ -17,20 +18,20 @@ end cmd :tree_merge, pos: '[[tree] [tree] ... (or stdin)]', desc: t('i18n_tasks.cmd.desc.tree_merge'), - args: [:data_format, :nostdin] + args: %i(data_format nostdin) def tree_merge(opts = {}) print_forest merge_forests_stdin_and_pos!(opts), opts end cmd :tree_filter, pos: '[pattern] [tree (or stdin)]', desc: t('i18n_tasks.cmd.desc.tree_filter'), - args: [:data_format, :pattern] + args: %i(data_format pattern) def tree_filter(opts = {}) pattern = arg_or_pos! :pattern, opts forest = forest_pos_or_stdin! opts unless pattern.blank? @@ -72,21 +73,21 @@ end cmd :tree_subtract, pos: '[[tree] [tree] ... (or stdin)]', desc: t('i18n_tasks.cmd.desc.tree_subtract'), - args: [:data_format, :nostdin] + args: %i(data_format nostdin) def tree_subtract(opt = {}) forests = forests_stdin_and_pos! opt, 2 forest = forests.reduce(:subtract_by_key) || empty_forest print_forest forest, opt end cmd :tree_set_value, pos: '[VALUE] [tree (or stdin)]', desc: t('i18n_tasks.cmd.desc.tree_set_value'), - args: [:value, :data_format, :nostdin, :pattern] + args: %i(value data_format nostdin pattern) def tree_set_value(opt = {}) value = arg_or_pos! :value, opt forest = forest_pos_or_stdin!(opt) key_pattern = opt[:pattern]