diff --git a/src/app/cli/interpreter.cpp b/src/app/cli/interpreter.cpp index 3889a486..d20ac1c0 100644 --- a/src/app/cli/interpreter.cpp +++ b/src/app/cli/interpreter.cpp @@ -213,7 +213,8 @@ const std::map &Interpreter::mUsageMap = *new std::map {"br", "br list [--nwk | --dom ]\n" "br add \n" "br delete ( | --nwk | --dom )\n" - "br scan [--nwk | --dom ] [--export ] [--timeout ] [--netif ]\n"}, + "br scan [--nwk | --dom ] [--export ] [--timeout ] " + "[--netif ]\n"}, {"domain", "domain list [--dom ]"}, {"network", "network save \n" "network sync\n" @@ -1421,7 +1422,7 @@ Interpreter::Value Interpreter::ProcessBr(const Expression &aExpr) const std::string kServiceName = "_meshcop._udp.local"; uint32_t scanTimeout = 10000; - std::string netIf = ""; + std::string netIf = ""; int mdnsSocket = -1; FDGuard fdgMdnsSocket; std::thread selectThread; @@ -1446,15 +1447,20 @@ Interpreter::Value Interpreter::ProcessBr(const Expression &aExpr) { ExitNow(value = ERROR_INVALID_ARGS("Imparsable timeout value '{}'", *it)); } - } else { + } + else + { ExitNow(value = ERROR_INVALID_ARGS("Missing {} value", *--it)); } - } else if (*it == "--netif") + } + else if (*it == "--netif") { if (++it != mContext.mCommandKeys.end()) { netIf = *it; - } else { + } + else + { ExitNow(value = ERROR_INVALID_ARGS("Missing {} value", *--it)); } } diff --git a/src/common/error_macros.hpp b/src/common/error_macros.hpp index ebd16d84..09051b42 100644 --- a/src/common/error_macros.hpp +++ b/src/common/error_macros.hpp @@ -137,10 +137,10 @@ { \ ErrorCode::kUnknown, fmt::format(FMT_STRING((aFormat)), ##__VA_ARGS__) \ } -#define ERROR_SOCKET_BIND_ERROR(aFormat, ...) \ - Error \ - { \ - ErrorCode::kSocketBindError, fmt::format(FMT_STRING((aFormat)), ##__VA_ARGS__) \ +#define ERROR_SOCKET_BIND_ERROR(aFormat, ...) \ + Error \ + { \ + ErrorCode::kSocketBindError, fmt::format(FMT_STRING((aFormat)), ##__VA_ARGS__) \ } #endif // ERROR_MACROS_HPP_