From: Pablo Neira Ayuso Date: Tue, 17 Dec 2024 17:35:38 +0000 (+0100) Subject: main: prepend error tag to printed errors when parsing options X-Git-Tag: v1.1.2~107 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e1b351300215d45a3f5a3f720e0001ec3091805a;p=thirdparty%2Fnftables.git main: prepend error tag to printed errors when parsing options Prepend "Error: " tag to printed errors in the option parsing step. Signed-off-by: Pablo Neira Ayuso --- diff --git a/src/main.c b/src/main.c index d13952cc..72151e62 100644 --- a/src/main.c +++ b/src/main.c @@ -395,7 +395,7 @@ int main(int argc, char * const *argv) case OPT_DEFINE: if (nft_ctx_add_var(nft, optarg)) { fprintf(stderr, - "Failed to define variable '%s'\n", + "Error: Failed to define variable '%s'\n", optarg); goto out_fail; } @@ -457,7 +457,7 @@ int main(int argc, char * const *argv) } if (i == array_size(debug_param)) { - fprintf(stderr, "invalid debug parameter `%s'\n", + fprintf(stderr, "Error: invalid debug parameter `%s'\n", optarg); goto out_fail; } @@ -478,7 +478,7 @@ int main(int argc, char * const *argv) #ifdef HAVE_LIBJANSSON output_flags |= NFT_CTX_OUTPUT_JSON; #else - fprintf(stderr, "JSON support not compiled-in\n"); + fprintf(stderr, "Error: JSON support not compiled-in\n"); goto out_fail; #endif break;