Program Arguments (int argc, char* argv[])

Is there a built-in way to access program arguments (int argc, char* argv[]) in OF? If not, I was thinking about making an ofxArgs addon…

ok, well I’ve got a basic version completed.

EDIT:
ofxArgs add-on page is now up at http://addons.openframeworks.cc/projects/show/ofxargs

oh yeah, wanted to add a little bit about the options versus arguments…

It’s implemented so everything will be stored in the argument list, which may then be retrieved using the get(int index) methods.

For your convenience, some basic option handling is added as well, it’s easiest to illustrate with some examples:

  
  
-key value ("-key" has "value")  
-key=value ("-key" has "value")  
key=value ("key" has "value")  
-key -value (no association)  
key value (no association)  
-key value1=value2  ("value1" has "value2")  
-key -value1=-value2 ("-value1" has "-value2")  
-key -value1 value2 ("-value1" has "value2")  
-key -value1 -value2 (no association)  
  

Take the first set (-key value) for example. This means that when you do args->get("-key"), the method returns “value”.

Please let me know of any improvements or suggestions for this system.

Cheers!