From 74dfffa9df361e35a5910f1cf5b1734571bbef91 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 10 Dec 2009 10:50:23 +0200 Subject: Allows additional options to be provided in files (--options-file) Implemented using the new argv_file_scanner scanner implementation. --- cli/options.ixx | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'cli/options.ixx') diff --git a/cli/options.ixx b/cli/options.ixx index 74d7b15..cfaf2ac 100644 --- a/cli/options.ixx +++ b/cli/options.ixx @@ -84,6 +84,20 @@ namespace cli return value_; } + // file_io_failure + // + inline file_io_failure:: + file_io_failure (const std::string& file) + : file_ (file) + { + } + + inline const std::string& file_io_failure:: + file () const + { + return file_; + } + // argv_scanner // inline argv_scanner:: @@ -103,6 +117,31 @@ namespace cli { return i_; } + + // argv_file_scanner + // + inline argv_file_scanner:: + argv_file_scanner (int& argc, + char** argv, + const std::string& option, + bool erase) + : argv_scanner (argc, argv, erase), + option_ (option), + skip_ (false) + { + } + + inline argv_file_scanner:: + argv_file_scanner (int start, + int& argc, + char** argv, + const std::string& option, + bool erase) + : argv_scanner (start, argc, argv, erase), + option_ (option), + skip_ (false) + { + } } // options @@ -282,3 +321,9 @@ reserved_name () const return this->reserved_name_; } +inline const std::string& options:: +options_file () const +{ + return this->options_file_; +} + -- cgit v1.1