aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/script/builtin-options.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-08-03 15:03:52 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-08-03 15:03:52 +0200
commitf7573d6fba84c596e02d6aae9f1e4c0bdada823a (patch)
tree01557a090399464bc1c653cbe046e329a04b2966 /libbuild2/script/builtin-options.ixx
parentdc3349218483292587047ccf3b8d61e9a3c9cca0 (diff)
Regenerate options parsing files
Diffstat (limited to 'libbuild2/script/builtin-options.ixx')
-rw-r--r--libbuild2/script/builtin-options.ixx32
1 files changed, 25 insertions, 7 deletions
diff --git a/libbuild2/script/builtin-options.ixx b/libbuild2/script/builtin-options.ixx
index bbd12b1..8fef25a 100644
--- a/libbuild2/script/builtin-options.ixx
+++ b/libbuild2/script/builtin-options.ixx
@@ -109,14 +109,29 @@ namespace build2
// argv_scanner
//
inline argv_scanner::
- argv_scanner (int& argc, char** argv, bool erase)
- : i_ (1), argc_ (argc), argv_ (argv), erase_ (erase)
+ argv_scanner (int& argc,
+ char** argv,
+ bool erase,
+ std::size_t sp)
+ : start_position_ (sp + 1),
+ i_ (1),
+ argc_ (argc),
+ argv_ (argv),
+ erase_ (erase)
{
}
inline argv_scanner::
- argv_scanner (int start, int& argc, char** argv, bool erase)
- : i_ (start), argc_ (argc), argv_ (argv), erase_ (erase)
+ argv_scanner (int start,
+ int& argc,
+ char** argv,
+ bool erase,
+ std::size_t sp)
+ : start_position_ (sp + static_cast<std::size_t> (start)),
+ i_ (start),
+ argc_ (argc),
+ argv_ (argv),
+ erase_ (erase)
{
}
@@ -129,8 +144,10 @@ namespace build2
// vector_scanner
//
inline vector_scanner::
- vector_scanner (const std::vector<std::string>& v, std::size_t i)
- : v_ (v), i_ (i)
+ vector_scanner (const std::vector<std::string>& v,
+ std::size_t i,
+ std::size_t sp)
+ : start_position_ (sp), v_ (v), i_ (i)
{
}
@@ -141,9 +158,10 @@ namespace build2
}
inline void vector_scanner::
- reset (std::size_t i)
+ reset (std::size_t i, std::size_t sp)
{
i_ = i;
+ start_position_ = sp;
}
}
}