title: C++ command line interface
body: <p>I'm currently designing a linux c++ application. It will be run from the command line, then once running I need to be able to issue commands to control its execution, ideally something like the following:</p>
  
  <pre><code>$ sudo ./myapplication
  APP &gt; 
  APP &gt; 
  APP &gt; //just pressing return
  APP &gt; openlog test1.txt //APP will now call the openlog function
  APP &gt;
  </code></pre>
  
  <p>I imagine this is a relatively simple task, but I have no idea what such an interface would be called in order to search for one. Does anybody know of a library or example that can perform this function? Or do I need to write my own using cout and cin? If so, would there be any preferred approach?</p>