summaryrefslogtreecommitdiff
path: root/cli/options.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-12-10 10:50:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-12-10 10:50:23 +0200
commit74dfffa9df361e35a5910f1cf5b1734571bbef91 (patch)
tree72c4751da28efd20e2ddcf374842f359fad67faf /cli/options.ixx
parent2dc2da5488ac32da8c6ff7cd0eeb5e1beb38c92f (diff)
Allows additional options to be provided in files (--options-file)
Implemented using the new argv_file_scanner scanner implementation.
Diffstat (limited to 'cli/options.ixx')
-rw-r--r--cli/options.ixx45
1 files changed, 45 insertions, 0 deletions
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_;
+}
+