{"record":{"id":"3f0bcb7c5df2857c","repo":"puppetlabs/puppet","slug":"option-long-options-need-two-dashes","errorCode":null,"errorMessage":"%{option}: long options need two dashes (--)","messagePattern":"%(.+?): long options need two dashes \\(--\\)","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/interface/option.rb","lineNumber":23,"sourceCode":"# {Puppet::Interface::OptionManager#option}, which is available on\n# {Puppet::Interface}, and then calling methods of\n# {Puppet::Interface::OptionBuilder} in the supplied block.\n# @api public\nclass Puppet::Interface::Option\n  include Puppet::Interface::TinyDocs\n\n  # @api private\n  def initialize(parent, *declaration, &block)\n    @parent   = parent\n    @optparse = []\n    @default  = nil\n\n    # Collect and sort the arguments in the declaration.\n    dups = {}\n    declaration.each do |item|\n      if item.is_a? String and item.to_s =~ /^-/ then\n        unless item =~ /^-[a-z]\\b/ or item =~ /^--[^-]/ then\n          raise ArgumentError, _(\"%{option}: long options need two dashes (--)\") % { option: item.inspect }\n        end\n\n        @optparse << item\n\n        # Duplicate checking...\n        # for our duplicate checking purpose, we don't make a check with the\n        # translated '-' -> '_'. Right now, we do that on purpose because of\n        # a duplicated option made publicly available on certificate and ca\n        # faces for dns alt names. Puppet defines 'dns_alt_names', those\n        # faces include 'dns-alt-names'.  We can't get rid of 'dns-alt-names'\n        # yet, so we need to do our duplicate checking on the untranslated\n        # version of the option.\n        # jeffweiss 17 april 2012\n        name = optparse_to_optionname(item)\n        if Puppet.settings.include? name then\n          raise ArgumentError, _(\"%{option}: already defined in puppet\") % { option: item.inspect }\n        end\n","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/interface/option.rb#L5-L41","documentation":"Error \"%{option}: long options need two dashes (--)\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/interface/option.rb:23 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}