From 6a9a911f05bbd0d2a63a06512733a4a6ff5b3e65 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 4 Oct 2009 13:58:20 +0200 Subject: Add --option-{prefix,separator} options --- cli/options.cxx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'cli/options.cxx') diff --git a/cli/options.cxx b/cli/options.cxx index 1cbbfb4..d92af58 100644 --- a/cli/options.cxx +++ b/cli/options.cxx @@ -5,6 +5,7 @@ #include "options.hxx" #include +#include #include #include #include @@ -147,6 +148,19 @@ namespace cli } }; + template + struct parser > + { + static int + parse (std::set& s, char** argv, int n) + { + X x; + int i (parser::parse (x, argv, n)); + s.insert (x); + return i; + } + }; + template struct parser > { @@ -231,6 +245,8 @@ options (int argc, hxx_suffix_ (".hxx"), ixx_suffix_ (".ixx"), cxx_suffix_ (".cxx"), + option_prefix_ ("-"), + option_separator_ ("--"), include_with_brackets_ (), include_prefix_ (), guard_prefix_ (), @@ -252,6 +268,8 @@ options (int start, hxx_suffix_ (".hxx"), ixx_suffix_ (".ixx"), cxx_suffix_ (".cxx"), + option_prefix_ ("-"), + option_separator_ ("--"), include_with_brackets_ (), include_prefix_ (), guard_prefix_ (), @@ -273,6 +291,8 @@ options (int argc, hxx_suffix_ (".hxx"), ixx_suffix_ (".ixx"), cxx_suffix_ (".cxx"), + option_prefix_ ("-"), + option_separator_ ("--"), include_with_brackets_ (), include_prefix_ (), guard_prefix_ (), @@ -295,6 +315,8 @@ options (int start, hxx_suffix_ (".hxx"), ixx_suffix_ (".ixx"), cxx_suffix_ (".cxx"), + option_prefix_ ("-"), + option_separator_ ("--"), include_with_brackets_ (), include_prefix_ (), guard_prefix_ (), @@ -329,6 +351,10 @@ struct _cli_options_map_init &::cli::thunk; _cli_options_map_["--cxx-suffix"] = &::cli::thunk; + _cli_options_map_["--option-prefix"] = + &::cli::thunk; + _cli_options_map_["--option-separator"] = + &::cli::thunk; _cli_options_map_["--include-with-brackets"] = &::cli::thunk; _cli_options_map_["--include-prefix"] = -- cgit v1.1