{"record":{"id":"8b69f33d3a91cb37","repo":"puppetlabs/puppet","slug":"option-duplicates-existing-alias-duplicate","errorCode":null,"errorMessage":"%{option}: duplicates existing alias %{duplicate} in %{parent}","messagePattern":"%(.+?): duplicates existing alias %(.+?) in %(.+?)","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/interface/option.rb","lineNumber":44,"sourceCode":"        @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\n    # Now, infer the name from the options; we prefer the first long option as\n    # the name, rather than just the first option.\n    @name = optparse_to_name(@optparse.find do |a| a =~ /^--/ end || @optparse.first)\n    @aliases = @optparse.map { |o| optparse_to_name(o) }\n","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/interface/option.rb#L26-L62","documentation":"Error \"%{option}: duplicates existing alias %{duplicate} in %{parent}\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/interface/option.rb:44 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"}