Jump to content

Command line parser


Recommended Posts

There are some programs that need to support complex command line options. If that's you then you might find this library useful.

This library provides a structured parsing of command lines with additional support for setting default values in the registry. To call the routine you describe your command line in an (N+1)x3 array, where N is the number of arguments. On return any argument that is recognised has index 1 set to that value.

If a parameter to the argument is required then index 2 has that value. Normal command line argument rules apply, with the following additional guidelines. Positional arguments are supported and must occur before all optional argumemts. Optional arguments are prefixed with either a '-' or a '/'. Positional arguments must be space separated (with required spaces must be embedded in quotation marks).

This routine is useful when your command line is becoming complex & powerful.

The automatic registry support makes the implementation very powerful. Up to two registry locations are supported: typically you c/would use one for HKCU (user defaults) and another for HKLM (computer defaults).

(Warning: This tool is in alpha state - so do not expect perfection - thanks in advance to those who try. My goal is to extend validation & rigour, eg to ensure a filename is valid and that parameters to arguments are properly specified.)


Link to comment
Share on other sites

If you follow through my signature you will be able to collect other the other library components. Let me know if that is a problem.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...