From 4ebfa259156ae42fbd44a3aeb7fd73a2d6569480 Mon Sep 17 00:00:00 2001 From: Jarryd Beck Date: Mon, 13 Nov 2017 17:57:26 +1100 Subject: [PATCH] Improve version and changelog --- CHANGELOG.md | 3 +++ include/cxxopts.hpp | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eea975d..50fc327 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,9 @@ options. The project adheres to semantic versioning. * A new `ParseResult` object that is the immutable result of parsing. It responds to the same `count` and `operator[]` as `Options` of 1.x did. +* The function `ParseResult::arguments` returns a vector of the parsed + arguments to iterate through in the order they were provided. +* The symbol `cxxopts::version` for the version of the library. ## 1.x diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp index ddfdb86..81fb872 100644 --- a/include/cxxopts.hpp +++ b/include/cxxopts.hpp @@ -25,8 +25,6 @@ THE SOFTWARE. #ifndef CXXOPTS_HPP_INCLUDED #define CXXOPTS_HPP_INCLUDED -#define CXXOPTS_VERSION 2.0.0 - #include #include #include @@ -40,6 +38,13 @@ THE SOFTWARE. #include #include +namespace cxxopts +{ + static constexpr struct { + uint8_t major, minor, patch; + } version = {2, 0, 0}; +} + //when we ask cxxopts to use Unicode, help strings are processed using ICU, //which results in the correct lengths being computed for strings when they //are formatted for the help output