Class: Options
Overview
rubocop:disable Metrics/ClassLength
Class Method Summary collapse
-
.file_options ⇒ Object
rubocop:disable Metrics/BlockLength rubocop:disable Metrics/MethodLength.
- .for(type) ⇒ Object
- .scan_options ⇒ Object
Class Method Details
.file_options ⇒ Object
rubocop:disable Metrics/BlockLength rubocop:disable Metrics/MethodLength
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 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 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/cfn-nag/cli_options.rb', line 26 def self. = '[options] <cloudformation template path ...>|' \ '<cloudformation template in STDIN>' = @custom_rule_exceptions_message version = @version Optimist. do usage version version opt :debug, 'Enable debug output', type: :boolean, required: false, default: false opt :allow_suppression, 'Allow using Metadata to suppress violations', type: :boolean, required: false, default: true opt :print_suppression, 'Emit suppressions to stderr', type: :boolean, required: false, default: false opt :rule_directory, 'Extra rule directory', type: :string, required: false, default: nil opt :profile_path, 'Path to a profile file', type: :string, required: false, default: nil opt :blacklist_path, 'Path to a blacklist file', type: :string, required: false, default: nil opt :parameter_values_path, 'Path to a JSON file to pull Parameter values from', type: :string, required: false, default: nil opt :condition_values_path, 'Path to a JSON file to pull Condition values from', type: :string, required: false, default: nil opt :isolate_custom_rule_exceptions, , type: :boolean, required: false, default: false opt :fail_on_warnings, 'Treat warnings as failing violations', type: :boolean, required: false, default: false opt :output_format, 'Format of results: [txt, json, colortxt]', type: :string, default: 'colortxt' opt :rule_repository, 'Path(s) to a rule repository to include in rule discovery', type: :strings, required: false end end |
.for(type) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/cfn-nag/cli_options.rb', line 13 def self.for(type) case type when 'file' when 'scan' else raise "Unsupported Options type #{type}; use 'file' or 'scan'" end end |
.scan_options ⇒ Object
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'lib/cfn-nag/cli_options.rb', line 97 def self. = 'CloudFormation template to nag on or directory of ' \ 'templates. Default is all *.json, *.yaml, *.yml ' \ 'and *.template recursively, but can be constrained ' \ 'by --template-pattern' = 'Within the --input-path, match files to scan ' \ 'against this regular expression' = @custom_rule_exceptions_message version = @version Optimist. do version version opt :input_path, , type: :string, required: true opt :output_format, 'Format of results: [txt, json, colortxt]', type: :string, default: 'colortxt' opt :debug, 'Enable debug output', type: :boolean, required: false, default: false opt :rule_directory, 'Extra rule directory', type: :string, required: false, default: nil opt :profile_path, 'Path to a profile file', type: :string, required: false, default: nil opt :blacklist_path, 'Path to a blacklist file', type: :string, required: false, default: nil opt :parameter_values_path, 'Path to a JSON file to pull Parameter values from', type: :string, required: false, default: nil opt :condition_values_path, 'Path to a JSON file to pull Condition values from', type: :string, required: false, default: nil opt :allow_suppression, 'Allow using Metadata to suppress violations', type: :boolean, required: false, default: true opt :print_suppression, 'Emit suppressions to stderr', type: :boolean, required: false, default: false opt :isolate_custom_rule_exceptions, , type: :boolean, required: false, default: false opt :template_pattern, , type: :string, required: false, default: '..*\.json|..*\.yaml|..*\.yml|..*\.template' opt :fail_on_warnings, 'Treat warnings as failing violations', type: :boolean, required: false, default: false opt :rule_repository, 'Path(s)s to rule repository to include in rule discovery', type: :strings, required: false end end |