From 1126227206687040b18f87f9381d59661cbea28f Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Sun, 3 Mar 2024 21:14:49 +0300 Subject: [PATCH] Add add_choices accepting std::vector to argparse for convenience. --- thirdparty/argparse/include/argparse/argparse.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/thirdparty/argparse/include/argparse/argparse.hpp b/thirdparty/argparse/include/argparse/argparse.hpp index ec06ba2376..51cf250571 100644 --- a/thirdparty/argparse/include/argparse/argparse.hpp +++ b/thirdparty/argparse/include/argparse/argparse.hpp @@ -783,6 +783,12 @@ public: return *this; } + template Argument &add_choices(std::vector &&choices) { + for (T &choice : choices) + add_choice(std::forward(choice)); + return *this; + } + template Argument &choices(T &&first, U &&... rest) { add_choice(std::forward(first));