{"record":{"id":"05309f89812e2e78","repo":"puppetlabs/puppet","slug":"option-already-defined-in-puppet","errorCode":null,"errorMessage":"%{option}: already defined in puppet","messagePattern":"%(.+?): already defined in puppet","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/interface/option.rb","lineNumber":39,"sourceCode":"      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\n        dup = dups[name]\n        if dup\n          raise ArgumentError, _(\"%{option}: duplicates existing alias %{duplicate} in %{parent}\") %\n                               { option: item.inspect, duplicate: dup.inspect, parent: @parent }\n        else\n          dups[name] = item\n        end\n      else\n        raise ArgumentError, _(\"%{option} is not valid for an option argument\") % { option: item.inspect }\n      end\n    end\n\n    if @optparse.empty? then\n      raise ArgumentError, _(\"No option declarations found while building\")\n    end\n","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/interface/option.rb#L21-L57","documentation":"Error \"%{option}: already defined in puppet\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/interface/option.rb:39 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"}