mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-04 15:14:39 +00:00
Clang-format the code
This commit is contained in:
parent
439b2d0941
commit
50c91a0bcc
@ -201,8 +201,8 @@ public:
|
|||||||
if (mIsOptional) {
|
if (mIsOptional) {
|
||||||
if (mIsUsed && mValues.size() != mNumArgs && !mDefaultValue.has_value()) {
|
if (mIsUsed && mValues.size() != mNumArgs && !mDefaultValue.has_value()) {
|
||||||
std::stringstream stream;
|
std::stringstream stream;
|
||||||
stream << mUsedName << ": expected " << mNumArgs
|
stream << mUsedName << ": expected " << mNumArgs << " argument(s). "
|
||||||
<< " argument(s). " << mValues.size() << " provided.";
|
<< mValues.size() << " provided.";
|
||||||
throw std::runtime_error(stream.str());
|
throw std::runtime_error(stream.str());
|
||||||
} else {
|
} else {
|
||||||
// TODO: check if an implicit value was programmed for this argument
|
// TODO: check if an implicit value was programmed for this argument
|
||||||
@ -220,8 +220,8 @@ public:
|
|||||||
} else {
|
} else {
|
||||||
if (mValues.size() != mNumArgs && !mDefaultValue.has_value()) {
|
if (mValues.size() != mNumArgs && !mDefaultValue.has_value()) {
|
||||||
std::stringstream stream;
|
std::stringstream stream;
|
||||||
stream << mUsedName << ": expected " << mNumArgs
|
stream << mUsedName << ": expected " << mNumArgs << " argument(s). "
|
||||||
<< " argument(s). " << mValues.size() << " provided.";
|
<< mValues.size() << " provided.";
|
||||||
throw std::runtime_error(stream.str());
|
throw std::runtime_error(stream.str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -256,7 +256,8 @@ public:
|
|||||||
* @throws std::logic_error in case of incompatible types
|
* @throws std::logic_error in case of incompatible types
|
||||||
*/
|
*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
std::enable_if_t<!details::is_container_v<T>, bool> operator==(const T &aRhs) const {
|
std::enable_if_t<!details::is_container_v<T>, bool>
|
||||||
|
operator==(const T &aRhs) const {
|
||||||
return get<T>() == aRhs;
|
return get<T>() == aRhs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -265,7 +266,8 @@ public:
|
|||||||
* @throws std::logic_error in case of incompatible types
|
* @throws std::logic_error in case of incompatible types
|
||||||
*/
|
*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
std::enable_if_t<details::is_container_v<T>, bool> operator==(const T &aRhs) const {
|
std::enable_if_t<details::is_container_v<T>, bool>
|
||||||
|
operator==(const T &aRhs) const {
|
||||||
using ValueType = typename T::value_type;
|
using ValueType = typename T::value_type;
|
||||||
auto tLhs = get<T>();
|
auto tLhs = get<T>();
|
||||||
if (tLhs.size() != aRhs.size())
|
if (tLhs.size() != aRhs.size())
|
||||||
@ -326,7 +328,8 @@ private:
|
|||||||
* Getter for container types
|
* Getter for container types
|
||||||
* @throws std::logic_error in case of incompatible types
|
* @throws std::logic_error in case of incompatible types
|
||||||
*/
|
*/
|
||||||
template <typename CONTAINER> details::enable_if_container<CONTAINER> get() const {
|
template <typename CONTAINER>
|
||||||
|
details::enable_if_container<CONTAINER> get() const {
|
||||||
using ValueType = typename CONTAINER::value_type;
|
using ValueType = typename CONTAINER::value_type;
|
||||||
CONTAINER tResult;
|
CONTAINER tResult;
|
||||||
if (!mValues.empty()) {
|
if (!mValues.empty()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user