summaryrefslogtreecommitdiff
path: root/cli/options.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-07-27 17:28:27 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-07-27 17:28:27 +0200
commit8c1e0035404050376350d5e9b9242f5d39a6b53e (patch)
tree1aa609d156a4e0c131caf40c2d070d20b304bdbf /cli/options.ixx
parentdca38b27afc25d329fd7a7241095b40e2a1ecae2 (diff)
Add support for direct file loading with argv_file_scanner
Diffstat (limited to 'cli/options.ixx')
-rw-r--r--cli/options.ixx29
1 files changed, 29 insertions, 0 deletions
diff --git a/cli/options.ixx b/cli/options.ixx
index ba5fff2..2b63fa8 100644
--- a/cli/options.ixx
+++ b/cli/options.ixx
@@ -194,6 +194,22 @@ namespace cli
}
inline argv_file_scanner::
+ argv_file_scanner (const std::string& file,
+ const std::string& option)
+ : argv_scanner (0, zero_argc_, 0),
+ option_ (option),
+ options_ (&option_info_),
+ options_count_ (1),
+ i_ (1),
+ skip_ (false)
+ {
+ option_info_.option = option_.c_str ();
+ option_info_.search_func = 0;
+
+ load (file);
+ }
+
+ inline argv_file_scanner::
argv_file_scanner (int& argc,
char** argv,
const option_info* options,
@@ -221,6 +237,19 @@ namespace cli
skip_ (false)
{
}
+
+ inline argv_file_scanner::
+ argv_file_scanner (const std::string& file,
+ const option_info* options,
+ std::size_t options_count)
+ : argv_scanner (0, zero_argc_, 0),
+ options_ (options),
+ options_count_ (options_count),
+ i_ (1),
+ skip_ (false)
+ {
+ load (file);
+ }
}
// options