title: Using ocaml Args in program
body: <p>I'm trying to create an ocaml program where a user enters input similar to command line arguments, such as......</p>
  
  <pre><code>./program
  $ -s foo -i 84
  $ -s bar -i 22
  </code></pre>
  
  <p>...basically a simple menu program.</p>
  
  <p>I was hoping to be able to use ocaml <a href="http://caml.inria.fr/pub/docs/manual-ocaml/libref/Arg.html" rel="nofollow">Args</a> to do this (especially with the 'usage', etc built in), but I realize this is just for the command line.  Is there a way to re-purpose this library to work for in-program user input, or is it better to hack something together from the <a href="http://caml.inria.fr/pub/docs/manual-ocaml/libref/Stream.html" rel="nofollow">Stream/Parser</a> library or a different solution entirely?</p>