From 72bd1b4cbf0b0577aee535891911a1fa72cbfc56 Mon Sep 17 00:00:00 2001 From: Pragadesh-45 Date: Thu, 21 Nov 2024 15:36:15 +0530 Subject: [PATCH] feat: rename CLI options for omitting and skipping headers to clarify reporter context --- packages/bruno-cli/src/commands/run.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/bruno-cli/src/commands/run.js b/packages/bruno-cli/src/commands/run.js index a07a1f98e..2b7dc96b2 100644 --- a/packages/bruno-cli/src/commands/run.js +++ b/packages/bruno-cli/src/commands/run.js @@ -259,14 +259,14 @@ const builder = async (yargs) => { type: 'boolean', description: 'Stop execution after a failure of a request, test, or assertion' }) - .option('omit-headers', { + .option('reporter-omit-headers', { type: 'boolean', - description: 'Omit headers in the output', + description: 'Omit headers from the reporter output', default: false }) - .option('skip-headers', { + .option('reporter-skip-headers', { type: 'array', - description: 'Skip specific headers in the output', + description: 'Skip specific headers from the reporter output', default: [] }) @@ -274,10 +274,10 @@ const builder = async (yargs) => { .example('$0 run request.bru --env local', 'Run a request with the environment set to local') .example('$0 run folder', 'Run all requests in a folder') .example('$0 run folder -r', 'Run all requests in a folder recursively') - .example('$0 run --omit-headers', 'Run all requests in a folder recursively with omitted headers in the output') + .example('$0 run --reporter-omit-headers', 'Run all requests in a folder recursively with omitted headers from the reporter output') .example( - '$0 run --skip-headers "Authorization"', - 'Run all requests in a folder recursively with skipped headers in the output' + '$0 run --reporter-skip-headers "Authorization"', + 'Run all requests in a folder recursively with skipped headers from the reporter output' ) .example( '$0 run request.bru --env local --env-var secret=xxx', @@ -329,8 +329,8 @@ const handler = async function (argv) { sandbox, testsOnly, bail, - omitHeaders, - skipHeaders + reporterOmitHeaders, + reporterSkipHeaders } = argv; const collectionPath = process.cwd(); @@ -543,7 +543,7 @@ const handler = async function (argv) { suitename: bruFilepath.replace('.bru', '') }); - if (omitHeaders) { + if (reporterOmitHeaders) { results.forEach((result) => { result.request.headers = {}; result.response.headers = {}; @@ -556,15 +556,15 @@ const handler = async function (argv) { } }; - if (skipHeaders?.length) { + if (reporterSkipHeaders?.length) { results.forEach((result) => { if (result.request?.headers) { - skipHeaders.forEach((header) => { + reporterSkipHeaders.forEach((header) => { deleteHeaderIfExists(result.request.headers, header); }); } if (result.response?.headers) { - skipHeaders.forEach((header) => { + reporterSkipHeaders.forEach((header) => { deleteHeaderIfExists(result.response.headers, header); }); }