mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-04 15:14:39 +00:00
Remove unused space in Argument structure
This commit is contained in:
parent
daeca099e2
commit
f7fe9cf439
@ -104,7 +104,8 @@ public:
|
|||||||
|
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
explicit Argument(Args... args)
|
explicit Argument(Args... args)
|
||||||
: mNames({std::move(args)...}), mIsOptional((is_optional(args) || ...)) {
|
: mNames({std::move(args)...}), mIsOptional((is_optional(args) || ...)),
|
||||||
|
mIsRequired(false), mIsUsed(false) {
|
||||||
std::sort(
|
std::sort(
|
||||||
mNames.begin(), mNames.end(), [](const auto &lhs, const auto &rhs) {
|
mNames.begin(), mNames.end(), [](const auto &lhs, const auto &rhs) {
|
||||||
return lhs.size() == rhs.size() ? lhs < rhs : lhs.size() < rhs.size();
|
return lhs.size() == rhs.size() ? lhs < rhs : lhs.size() < rhs.size();
|
||||||
@ -357,11 +358,10 @@ private:
|
|||||||
std::in_place_type<valued_action>,
|
std::in_place_type<valued_action>,
|
||||||
[](const std::string &aValue) { return aValue; }};
|
[](const std::string &aValue) { return aValue; }};
|
||||||
std::vector<std::any> mValues;
|
std::vector<std::any> mValues;
|
||||||
std::vector<std::string> mRawValues;
|
|
||||||
size_t mNumArgs = 1;
|
size_t mNumArgs = 1;
|
||||||
bool mIsOptional = false;
|
bool mIsOptional : 1;
|
||||||
bool mIsRequired = false;
|
bool mIsRequired : 1;
|
||||||
bool mIsUsed = false; // relevant for optional arguments. True if used by user
|
bool mIsUsed : 1; // True if the optional argument is used by user
|
||||||
|
|
||||||
static constexpr auto mHelpOption = "-h";
|
static constexpr auto mHelpOption = "-h";
|
||||||
static constexpr auto mHelpOptionLong = "--help";
|
static constexpr auto mHelpOptionLong = "--help";
|
||||||
|
Loading…
Reference in New Issue
Block a user