From 0267ede2d356abdef7b3e9af19d4725605a58947 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 20 Jan 2011 15:38:10 +0200 Subject: Add support for multiple file options and file search callbacks --- doc/guide/index.xhtml | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'doc') diff --git a/doc/guide/index.xhtml b/doc/guide/index.xhtml index 67d6569..bc215e3 100644 --- a/doc/guide/index.xhtml +++ b/doc/guide/index.xhtml @@ -732,22 +732,44 @@ namespace cli public: argv_file_scanner (int& argc, char** argv, - const std::string& file_option, + const std::string& option, bool erase = false); argv_file_scanner (int start, int& argc, char** argv, - const std::string& file_option, + const std::string& option, + bool erase = false); + + struct option_info + { + const char* option; + std::string (*search_func) (const char*, void* arg); + void* arg; + }; + + argv_file_scanner (int& argc, + char** argv, + const option_info* options, + std::size_t options_count, + bool erase = false); + + argv_file_scanner (int start, + int& argc, + char** argv, + const option_info* options, + std::size_t options_count, bool erase = false); ... }; } -

The file_option argument is used to pass the option name - that should be recognized as specifying the file containing additional - options. Such a file contains a set of options, each appearing on a +

The option argument in the first two constructors and + the options and options_count arguments + in the last two are used to pass the option name(s) that should be + recognized as specifying the file containing additional options. + Such a file contains a set of options, each appearing on a separate line optionally followed by space and an option value. Empty lines and lines starting with # are ignored. Option values can be enclosed in double (") or single (') -- cgit v1.1