47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
# File 'lib/hammer_cli_foreman/filter.rb', line 47
def self.included(base)
def taxonomy_options?
opt_names = ['location_ids', 'organization_ids']
opt_names += resolver.searchables(:locations).map { |s| 'location_' + s.plural_name }
opt_names += resolver.searchables(:organizations).map { |s| 'organization_' + s.plural_name }
opt_names.any? { |opt| send(HammerCLI.option_accessor_name(opt)) }
end
def signal_override_usage_error
signal_usage_error _('Organizations and locations can be set only for overriding filters.')
end
base.extend_help do |base_h|
base_h.section(_('Overriding organizations and locations')) do |section_h|
override_condition = "--override=true"
org_opts = '--organization[s|-ids]'
loc_opts = '--location[s|-ids]'
section_h.text(_("Filters inherit organizations and locations from its role by default. This behavior can be changed by setting %{condition}.%{wsp}" +
"Therefore options %{org_opts} and %{loc_opts} are applicable only when the override flag is set.") % {
:wsp => "\n",
:org_opts => org_opts,
:loc_opts => loc_opts,
:condition => override_condition
})
end
end
end
|