Skip to content

Commit 42abbce

Browse files
committed
add the debug option and tests for it.
1 parent 11f6a6b commit 42abbce

File tree

2 files changed

+364
-4
lines changed

2 files changed

+364
-4
lines changed

codegens/postman-cli/lib/index.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ function initializeOptions (options, request) {
3939
format: options.longFormat,
4040
trim: options.trimRequestBody,
4141
quiet: options.quiet,
42+
debug: options.debug,
4243
followOriginalHttpMethod: options.followOriginalHttpMethod,
4344
quoteType,
4445
url,
@@ -67,7 +68,7 @@ function buildBaseCommand (request, opts, options) {
6768
}
6869

6970
/**
70-
* Add quiet and timeout flags to snippet
71+
* Add quiet, debug and timeout flags to snippet
7172
*
7273
* @param {string} snippet - Current snippet
7374
* @param {Object} opts - Extracted options
@@ -77,6 +78,9 @@ function addQuietAndTimeout (snippet, opts) {
7778
if (opts.quiet) {
7879
snippet += `${opts.indent}${form('-q', opts.format)}`;
7980
}
81+
if (opts.debug) {
82+
snippet += `${opts.indent}--debug`;
83+
}
8084
if (opts.timeout > 0) {
8185
snippet += `${opts.indent}--timeout ${opts.timeout}`;
8286
}
@@ -437,6 +441,13 @@ self = module.exports = {
437441
type: 'boolean',
438442
default: false,
439443
description: 'Display the requested data without showing any extra output.'
444+
},
445+
{
446+
name: 'Use Debug Mode',
447+
id: 'debug',
448+
type: 'boolean',
449+
default: false,
450+
description: 'Show detailed execution information including retry attempts, redirects, and timing breakdowns.'
440451
}
441452
];
442453
}

0 commit comments

Comments
 (0)