Skip to content

Commit 5ee005f

Browse files
author
Dhwaneet Bhatt
authored
Merge pull request #676 from postmanlabs/feature/add-long-form-option-for-globoff
Add long form option for -g
2 parents 77b4151 + 0d23e9c commit 5ee005f

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

codegens/curl/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ self = module.exports = {
3636
snippet += ` ${form('-m', format)} ${timeout}`;
3737
}
3838
if ((url.match(/[{[}\]]/g) || []).length > 0) {
39-
snippet += ' -g';
39+
snippet += ` ${form('-g', format)}`;
4040
}
4141
if (multiLine) {
4242
indent = options.indentType === 'Tab' ? '\t' : ' ';

codegens/curl/lib/util.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ var self = module.exports = {
5757
return '--data';
5858
case '-F':
5959
return '--form';
60+
case '-g':
61+
return '--globoff';
6062
default:
6163
return '';
6264
}

codegens/curl/test/unit/convert.test.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ describe('curl convert function', function () {
265265
']world',
266266
'world}'
267267
].forEach(function (value) {
268-
request = new sdk.Request({
268+
const request = new sdk.Request({
269269
'method': 'GET',
270270
'url': {
271271
'raw': `http://example.com?hello=${value}`,
@@ -288,6 +288,12 @@ describe('curl convert function', function () {
288288
}
289289
expect(snippet).to.include('-g');
290290
});
291+
convert(request, { longFormat: true }, function (error, snippet) {
292+
if (error) {
293+
expect.fail(null, null, error);
294+
}
295+
expect(snippet).to.include('--globoff');
296+
});
291297
});
292298
});
293299

0 commit comments

Comments
 (0)