spice-example-sh: add parameter parser

As suggested by Michael in the forum.
spice-example-sh: improve error handling