Because it might be a common mistake to pass a single string, this
situation is treated separately.
Since we were making a copy of the longopts list anyway, we now use
the list() function -- this made it necessary to change all uses of
the local variable (and argument) 'list' to something more meaningful,
i.e., 'opts'.
Also added docstrings (copied from the library manual) and removed the
(now redundant) module comments.