Parse Args that aren't declared
<p>I'm writing a utility for running bash commands that essentially takes as input a string and a list optional argument and uses the optional arguments to interpolate string.</p>

<p>I'd like it to work like this:</p>

<pre><code>interpolate.py Hello {user_arg} my name is {computer_arg} %% --user_arg=john --computer_arg=hal
</code></pre>

<p>The <code>%%</code> is a separator, it separates the string to be interpolated from the arguments. What follows is the arguments used to interpolate the string. In this case the user has chosen  <code>user_arg</code> and <code>computer_arg</code> as arguments. The program can't know in advance which argument names the user will choose.</p>

<p>My problem is how to parse the arguments? I can trivially split the input arguments on the separator but I can't figure out how to get optparse to just give the list of optional args as a dictionary, without specifying them in advance. Does anyone know how to do this without writing a lot of regex?</p>
