From ec2c2c8c3703d26042a0647ba5c3931e57187d3e Mon Sep 17 00:00:00 2001 From: zawz Date: Fri, 4 Oct 2019 02:47:42 +0200 Subject: [PATCH] options: added possibility to ignore negative numbers as options --- include/options.hpp | 4 +-- src/options.cpp | 85 +++++++++++++++++++++++++-------------------- 2 files changed, 49 insertions(+), 40 deletions(-) diff --git a/include/options.hpp b/include/options.hpp index aad170f..4a63406 100644 --- a/include/options.hpp +++ b/include/options.hpp @@ -136,12 +136,12 @@ namespace ztd @param arguments vector of string containing arguments and options @return Leftover arguments that are not options\n */ - std::vector process(std::vector arguments); + std::vector process(std::vector arguments, bool ignore_numbers=false); //! @brief Process arguments through the option set /*! calls process(std::vector arguments) */ - inline std::vector process(int argc, char** argv) { return this->process(ztd::argVector(argc, argv)); } + inline std::vector process(int argc, char** argv, bool ignore_numbers=false) { return this->process(ztd::argVector(argc, argv), ignore_numbers); } //! @brief Options in the set std::vector