Possibly the least verbose command line parsing library for C++
MS-PL License
Bot releases are hidden (Show)
Published by kamchatka-volcano over 1 year ago
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.Published by kamchatka-volcano over 1 year ago
CommandLineReader::exec()
failure exit code from -1 to 1;Published by kamchatka-volcano over 1 year ago
CommandLineReader::exec()
overloads taking wide string arguments on Windowsstd::wstring
and std::filesystem::path
with UTF16 encoding on WindowsPostProcessor
- the class template that allows to check or change the state of the config object after it was read;Published by kamchatka-volcano over 1 year ago
Maintenance
sfun
to 3.1.1SealLake_IsInstalled
CMake function to only install dependencies when cmdlime
is installedPublished by kamchatka-volcano almost 2 years ago
cmdlime::Config
constructors with using Config::Config;
declaration)clang-format
configPublished by kamchatka-volcano almost 2 years ago
nameof
library, now cmdlime
can be used with MSVC compiler when functionality provided by nameof
is enabled (C++20 is required)Published by kamchatka-volcano almost 2 years ago
seal_lake
libraryPublished by kamchatka-volcano about 2 years ago
sfun
library to v2.1.1
Published by kamchatka-volcano about 2 years ago
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
emplace_back
operation(within STL it's vector
, deque
, and list
).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>();
}
cmdlime::optional
instead of std::optional
. cmdlime::optional
- is a std::optional-like wrapper with similar interface.sfun
and gsl
library were replaced with their fetched versions, system wide installation of nameof
library was disabled.Published by kamchatka-volcano over 2 years ago
USE_NAMEOF
to CMDLIME_USE_NAMEOF
cmdlime/shortmacros.h
header containing registration macros without prefix CMDLIME_
(use them if there's no possible macros name conflicts)Published by kamchatka-volcano over 2 years ago
Published by kamchatka-volcano over 2 years ago
Published by kamchatka-volcano over 2 years ago
Published by kamchatka-volcano almost 3 years ago
Initial version