diff --git a/docs/manual.html b/docs/manual.html index ccaa29f..302da84 100644 --- a/docs/manual.html +++ b/docs/manual.html @@ -149,7 +149,7 @@ of "-s asdf", you can do so.
  • If a required argument isn't provided, the program exits and displays the USAGE, along with an error message.
  • -

    Basic Properties

    +

    Basic Properties

    Arguments, whatever their type, have a few common basic properties. First is the flag or the character preceeded by a dash(-) that signals the beginning of the argument. Arguments also have names, which can, if desired also be @@ -215,7 +215,7 @@ More later on how we get this to work.

    Complications

    Naturally, what we have seen to this point doesn't satisfy all of our needs. -

    I tried passing multiple values on the command line with the same flag and it didn't work...

    +

    I tried passing multiple values on the command line with the same flag and it didn't work...

    Correct. You can neither specify mulitple ValueArgs or SwitchArgs with the same flag in the code nor on the command line. Exceptions will occur in either case. For SwitchArgs it simply doesn't @@ -250,7 +250,7 @@ A MultiArg is declared much like a ValueArg: Note that MultiArgs can be added to the CmdLine in any order (unlike UnlabeledMultiArgs). -

    But I don't like labelling all of my arguments...

    +

    But I don't like labelling all of my arguments...

    To this point all of our arguments have had labels (flags) indentifying them on the command line, but there are some situations where flags are burdensome and not worth the effort. @@ -287,7 +287,7 @@ is important for unlabeled arguments. -

    But I want an arbitrary number of arguments to be accepted...

    +

    But I want an arbitrary number of arguments to be accepted...

    Don't worry, we've got you covered. Say you want a strange command that searches each file specified for a given string (lets call it grep), but you don't want to have to type in all of the file names or write a @@ -348,7 +348,7 @@ floats, etc.) then just declare the UnlabeledMultiArg as type and parse the different values yourself. -

    I want one argument or the other, but not both...

    +

    I want one argument or the other, but not both...

    New Feature! Suppose you have a command that must read input from one of two possible locations, either a local file or a URL. The command must read something, so one argument is required, but not both, @@ -403,6 +403,30 @@ was not xor'd and wasn't matched, it will also return FALSE.)

    + +

    I have more arguments than single flags make sense for...

    +New Feature! Some commands have so many options that single flags +no longer map sensibly to the available options. In this case, it is +desirable to specify Args using only long options. +This one is easy to accomplish, just make the flag value blank in +the Arg constructor. This will tell the Arg that only the +long option should be matched and will force users to specify the long +option on the command line. +The help output is updated accordingly. +

    +
    +
    +	...
    +
    +	ValueArg < string >  fileArg("","file","File name",true,"homer","filename");
    +
    +	SwitchArg  caseSwitch("","upperCase","Print in upper case",false);
    +
    +	...
    +
    +
    +

    +

    Visitors

    Disclaimer: Almost no one will have any use for Visitors, they were added @@ -467,7 +491,7 @@ processing any further (as specified in the visit() method).

    Exceptions

    Like all good rules, there are many exceptions.... -

    Ignoring arguments...

    +

    Ignoring arguments...

    The -- flag is automatically included in the CmdLine. As (almost) per POSIX and GNU standards, any argument specified after the -- flag is ignored. Almost because if an UnlabeledValueArg that has @@ -484,7 +508,7 @@ ignore arguments after the --. To accomodate this, we can make both UnlabeledValueArgs and UnlabeledMultiArgs ignoreable in their constructors. See the API Documentation for details. -

    Multiple Identical Switches

    +

    Multiple Identical Switches

    If you absolutely must allow for multiple, identical switches to be allowed, don't use a SwitchArg, instead use a MultiArg of type bool. This means you'll need to specify @@ -492,7 +516,7 @@ a 1 or 0 on the command line with the switch (as values are required), but this should allow you to turn your favorite switch on and off to your hearts content. -

    Type Descriptions

    +

    Type Descriptions

    Ideally this library would use RTTI to return a human readable name of the type declared for a particular argument. Unfortunately, at least for g++, the names returned aren't particularly useful.