I have a function with many of its own options, but I would also like to pass options to subfunctions using the FilterRules function. Here's a simple example:
Options[pfunc] = {"test" -> True}; pfunc[x0_, plotopts : OptionsPattern[]] := Module[{}, Plot[x^2, {x, -x0, x0}, PlotStyle -> If[OptionValue["test"], Red, Blue], Evaluate[FilterRules[{plotopts}, Options[Plot]]]]] When I just try to use the options of the pfunc it works just fine
pfunc[7] pfunc[7, "test" -> False]

But if I try to use an internal argument for Plot, it produces the figure as expected but gives error messages.
pfunc[7, "test" -> False, Frame -> True, Axes -> False] (* OptionValue::nodef: Unknown option Frame for pfunc. >> OptionValue::nodef: Unknown option Axes for pfunc. >> OptionValue::nodef: Unknown option BaseStyle for pfunc. >> General::stop: Further output of OptionValue::nodef will be suppressed during this calculation. >> *) 
Why does it give these errors? Furthermore, what if I need to pass options to different subfunctions?




Options[pfunc] = Join[{"test" -> True}, Options[Plot]]... $\endgroup$