kvoptions package gives you the possibility to define key=value style options. It "connects package keyval with LATEX's package and class options" (quote from the manual).
You can then declare options like
<init> is the initial value (also used when the option is not used),
<key> stands for the option name and
<default> for the default value used when the option is used without an value (
foobar instead of
If no default value is given the option requires a value, which makes sense for an option like
margin for example.
pgfopts package is an alternative and uses the
pgfkeys package, i.e. the key-value engine of PGF/TikZ, which is IMHO more powerful and flexible than
Please note that keys with spaces are not supported as package or class options because the internal LaTeX macros remove all spaces from the options before the above package receive them.