Difference between revisions of "Tutorial:OptionParser"

From MSL-Libraries
Jump to navigationJump to search
(Created page with 'This is an example of how to add and use the MSL command-line parser ( '''OptionParser object''' ). <font color="red"> WARNING: Tutorial writing i…')
 
Line 1: Line 1:
This is an example of how to add and use the MSL command-line parser ( '''[[MSL Objects:OptionParser|OptionParser object]]''' ).   
+
This is an example of how to add and use the MSL command-line parser ( '''[[MSL Objects:OptionParser|OptionParser object]]''' ).  This tutorial will also discuss the common conventions used when using OptionParser to write MSL programsIt is good to follow these conventions so that most MSL developers can easily read and help fix the option parsing code of any MSL program.
  
 
<font color="red"> WARNING: Tutorial writing in progress, some errors may exist.</font>
 
<font color="red"> WARNING: Tutorial writing in progress, some errors may exist.</font>
  
 
[http://mslib.svn.sourceforge.net/viewvc/mslib/trunk/examples/example_option_parser.cpp?view=markup Complete source of example_option_parser.cpp]
 
[http://mslib.svn.sourceforge.net/viewvc/mslib/trunk/examples/example_option_parser.cpp?view=markup Complete source of example_option_parser.cpp]
 +
 +
[http://mslib.svn.sourceforge.net/viewvc/mslib/trunk/examples/example_option_parser.h?view=markup Complete source of example_option_parser.h]
  
  
Line 19: Line 21:
 
=== Program description ===
 
=== Program description ===
  
 +
Conventions
  
 
----
 
----

Revision as of 15:19, 5 April 2010

This is an example of how to add and use the MSL command-line parser ( OptionParser object ). This tutorial will also discuss the common conventions used when using OptionParser to write MSL programs. It is good to follow these conventions so that most MSL developers can easily read and help fix the option parsing code of any MSL program.

WARNING: Tutorial writing in progress, some errors may exist.

Complete source of example_option_parser.cpp

Complete source of example_option_parser.h


To compile

% make bin/example_option_parser

To run the program

Go to the main directory and run the command

% bin/example_option_parser

Program description

Conventions


Back to the tutorial page