This is a modified version of "Unused global options(s)" when using arguments in options of class. The question is how to create a parasitic class (i.e. one which loads another) which accepts key-value options specific to that class, but does not generate warnings about unknown options.
Consider,
\begin{filecontents}[overwrite]{\jobname.cls} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{\jobname} \DeclareOption{bertha}{} \DeclareKeys[testwork]{% test .code ={\newcommand{\foo}{#1}}, test .usage = load, } \ProcessKeyOptions[testwork] \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} \ProcessOptions\relax \LoadClass{article} \endinput \end{filecontents} \documentclass[test=wtf,bertha]{\jobname} \begin{document} test \foo \end{document} Compiling this example produces the typeset result expected, but the messages printed to the terminal and recorded in the log are not quite as expected.
LaTeX Warning: Unused global option(s): [test]. In the original question, the key-value option is created using xkeyval. I could not figure out how to avoid the warning in that case, but I hoped that using the built-in framework for declaring key-value options would be handled better.
According to clsguide.pdf only options not declared by the parasitic class should be passed to article. This is true, for example, of bertha. But it is not, apparently, true of test. Moreover, if test=wtf was passed to article, I'd expect it to be passed together with its value i.e. I'd expect a warning about test=wtf as opposed to test.
Obviously, I'm not setting this up correctly, but I'm not sure what I'm doing wrong. How is this supposed to be done exactly?
.clsfile which might be used in your company, is distributed via GitHub/Lab etc. or will be submitted to CTAN, those warnings could confuse other users.\CurrentOptionlikeexpkv-opt:Pexpkvseparates between keys taking a value and keys not taking a value, soberthacould be an option that really doesn't want a value (and would throw an error accordingly if given one -- you could use the.value_forbidden:nproperty to get the same behaviour inl3keys).xkeyval,pgfkeys, the l3 stuff and maybe some older interfaces, while packages I use loadkvoptionsetc., too. I can't avoid multiple methods entirely, but I'd like to keep the setup as simple as practicable. (And I'm sure if I tried your package, I'd want to use it, so I'd best not ;).)