From d6427addaf7de41d401dd2a871b4789022e5f7cf Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 5 Jan 2018 15:06:24 +0200 Subject: Extend find_option_prefix() to return option --- build2/utility.hxx | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'build2/utility.hxx') diff --git a/build2/utility.hxx b/build2/utility.hxx index db6460c..cfdaee0 100644 --- a/build2/utility.hxx +++ b/build2/utility.hxx @@ -511,51 +511,54 @@ namespace build2 bool find_options (initializer_list, const cstrings&, bool = false); - // As above but look for an option that has the specified prefix. + // As above but look for an option that has the specified prefix. Return the + // pointer to option or NULL if not found (thus can be used as bool). + // Search backward (which is normall consistent with how options override + // each other). // template - bool + const string* find_option_prefix (const char* prefix, T&, const variable&, bool = false); template - bool + const string* find_option_prefix (const char* prefix, T&, const char*, bool = false); - bool + const string* find_option_prefix (const char* prefix, const lookup&, bool = false); - bool + const string* find_option_prefix (const char* prefix, const strings&, bool = false); - bool + const char* find_option_prefix (const char* prefix, const cstrings&, bool = false); // As above but look for several option prefixes. // template - bool + const string* find_option_prefixes (initializer_list, T&, const variable&, bool = false); template - bool + const string* find_option_prefixes (initializer_list, T&, const char*, bool = false); - bool + const string* find_option_prefixes (initializer_list, const lookup&, bool = false); - bool + const string* find_option_prefixes (initializer_list, const strings&, bool = false); - bool + const char* find_option_prefixes (initializer_list, const cstrings&, bool = false); -- cgit v1.1