From 0f874b5e90969ab255ccb48f80c392440aa591bd Mon Sep 17 00:00:00 2001 From: mes5k Date: Wed, 10 Sep 2008 18:21:49 +0000 Subject: [PATCH] added note on xor --- docs/manual.xml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/manual.xml b/docs/manual.xml index 9ef5841..752aee2 100644 --- a/docs/manual.xml +++ b/docs/manual.xml @@ -654,6 +654,28 @@ wasn't matched, it will also return FALSE.) throw("Very bad things..."); + +It is helpful to note that Args of any type can be xor'd together. +This means that you can xor a SwitchArg with a ValueArg. +This is helpful in situations where one of several options is necessary and one of the options +requires additional information. + + + + SwitchArg sss("s", "stdin", "read from STDIN", false); + ValueArg<string> fff("f", "file", "read from file", false, "/dev/null", "string"); + ValueArg<string> uuu("u", "url", "read from URL", false, "http://example.com", "string"); + + vector<Arg*> xorlist; + xorlist.push_back(&sss); + xorlist.push_back(&fff); + xorlist.push_back(&uuu); + + cmd.xorAdd( xorlist ); + + + +