cmdlime

Possibly the least verbose command line parsing library for C++

MS-PL License

Stars
85

Bot releases are hidden (Show)

cmdlime - v2.6.0 Latest Release

Published by kamchatka-volcano 4 months ago

  • Updated seal_lake to v0.2.0, now the CPM.cmake package manager is used to download dependencies. The variable CPM_SOURCE_CACHE can be set to an arbitrary directory to speed up CMake reconfiguration.
  • Updated sfun to v5.1.0
cmdlime - v2.5.0

Published by kamchatka-volcano over 1 year ago

  • Now std::filesystem::path parameters are converted to the canonical form by default. If necessary, this can be disabled with the CMDLIME_NO_CANONICAL_PATHS compiler definition or CMake variable.
cmdlime - v2.4.1

Published by kamchatka-volcano over 1 year ago

  • changed CommandLineReader::exec() failure exit code from -1 to 1;
cmdlime - v2.4.0

Published by kamchatka-volcano over 1 year ago

  • Added CommandLineReader::exec() overloads taking wide string arguments on Windows
  • Added the support for reading std::wstring and std::filesystem::path with UTF16 encoding on Windows
    Readme
    -Added PostProcessor - the class template that allows to check or change the state of the config object after it was read;
    Readme
cmdlime - v2.3.1

Published by kamchatka-volcano over 1 year ago

Maintenance

  • Updated sfun to 3.1.1
  • Started using SealLake_IsInstalled CMake function to only install dependencies when cmdlime is installed
cmdlime - v2.3.0

Published by kamchatka-volcano almost 2 years ago

  • Added handling for ValidationError exceptions to the StringConverter::fromString method and included information from the ValidationError exceptions in the parsing error messages. (example)
cmdlime - v2.2.0

Published by kamchatka-volcano almost 2 years ago

  • Fixed #25
    From now on non-aggregate types can be used as config structures (the user must inherit cmdlime::Config constructors with using Config::Config; declaration)
  • Added clang-format config
cmdlime - v2.1.1

Published by kamchatka-volcano almost 2 years ago

  • Updated the nameof library, now cmdlime can be used with MSVC compiler when functionality provided by nameof is enabled (C++20 is required)
cmdlime - v2.1.0

Published by kamchatka-volcano almost 2 years ago

  • Fixed issues on MSVC compiler
  • Changed pragma once to macro include guards
  • Updated CMake config to use seal_lake library
  • Added GitHub Actions configuration for CI pipeline
cmdlime - v2.0.1

Published by kamchatka-volcano about 2 years ago

  • updated sfun library to v2.1.1
cmdlime - v2.0.0

Published by kamchatka-volcano about 2 years ago

  • BREAKING Now configs are created and read with a CommandLineReader object.
    So instead of
auto cfg = MyCfg{};
cfg.readCommandLine(argc, argv);

you need to write it like that:

auto reader = cmdlime::CommandLineReader{};
auto cfg = reader.read<MyCfg>(argc, argv);

This change was required for placing all config structure registration data outside the config object.
Now cmdlime::Config contains only a single pointer, besides the user provided data, so by default the config object is a copyable aggregate that can be used however you want.
ConfigReader was removed. Its functionally providing automatic error handling and --help and --version flags handling support was moved to CommandLineReader::exec() method. Read about it here

  • BREAKING Now PARAMLIST and ARGLIST macros are required to provide a container type, it can be any sequence container, supporting emplace_back operation(within STL it's vector, deque, and list).
    So instead of
struct MyCfg : cmdlime::Config{
   PARAMLIST(pList, int);
   ARGLIST(aList, std::string);
}

you need to write it like that:

struct MyCfg : cmdlime::Config{
   PARAMLIST(pList, std::vector<int>);
   ARGLIST(aList, std::list<string>);
}

Registration without macros can also use any dynamic sequence container from now on:

struct MyCfg : cmdlime::Config{
   std::deque<int> pList = paramList<&MyCfg::pList>();
   std::list<string> aList = argList<&MyCfg::aList>();
}
  • BREAKING Now optional config fields have to use cmdlime::optional instead of std::optional. cmdlime::optional - is a std::optional-like wrapper with similar interface.
  • bundled parts of sfun and gsl library were replaced with their fetched versions, system wide installation of nameof library was disabled.
cmdlime - v1.1.0

Published by kamchatka-volcano over 2 years ago

  • Fixed the issue #19
  • Renamed CMakeLists variable USE_NAMEOF to CMDLIME_USE_NAMEOF
  • Added cmdlime/shortmacros.h header containing registration macros without prefix CMDLIME_ (use them if there's no possible macros name conflicts)
cmdlime - v1.0.1

Published by kamchatka-volcano over 2 years ago

  • Removed bundled library dependencies from the CMake package config
cmdlime - v1.0.0

Published by kamchatka-volcano over 2 years ago

  • BREAKING To support user defined types, now it's required to provide specialization of StringConverter class, instead of overloads of << and >> operators. Read about it here
    While technically, it's not a breaking change (as providing << and >> overloads will work with default StringConverter implementation) it's recommended to update your code.
  • BREAKING Signatures of usageInfo() and usageInfoDetailed() were changed - program name and output format structure are now set to config with setProgramName and setUsageInfoFormat methods.
  • Added validation of command line options. Read about it here.
  • Added macros free registration of command line options. Read about it here.
  • Vendored sfun and GSL libraries, now the only external dependency is the nameof library which is optional and disabled by default. (nameof is required for concise macros free registration).
cmdlime - v0.10.0

Published by kamchatka-volcano over 2 years ago

  • Added package configs to CMakeLists.txt, now installed library can be found by CMake with find_package() command.
  • Fixed a CMake error, now there is no conflict when parent project also uses the sfun library.
cmdlime - v0.9.0

Published by kamchatka-volcano almost 3 years ago

Initial version