regression: CLI processing of globs
- Ngôn ngữ chính
- TypeScript
- Star
- 1.2k
- Fork
- 242
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
The prior version of HTTPSnippet allowed processing of globs on the CLI as follows:
```shell
httpsnippet ./*.json --target node --client request --output ./snippets
```
```shell
$ tree snippets/
snippets/
├── endpoint-1.js
├── endpoint-2.js
└── endpoint-3.js
```
I wasn't aware of this prior functionality (and there were no tests covering it) so it was missed.
Shouldn't be too terrible to add back. Let's have some tests for it this time, too.
### Reproduction steps
run the following:
```shell
./bin/httpsnippet src/fixtures/requests/*.json --target node --client unirest --output ./example
```
And it returns this input:
```text
Unknown arguments: src/fixtures/requests/application-json.json, src/fixtures/requests/cookies.json, src/fixtures/requests/custom-method.json, src/fixtures/requests/full.json, src/fixtures/requests/headers.json, src/fixtures/requests/https.json, src/fixtures/requests/jsonObj-multiline.json, src/fixtures/requests/jsonObj-null-value.json, src/fixtures/requests/multipart-data.json, src/fixtures/requests/multipart-file.json, src/fixtures/requests/multipart-form-data.json, src/fixtures/requests/multipart-form-data-no-params.json, src/fixtures/requests/nested.json, src/fixtures/requests/query.json, src/fixtures/requests/short.json, src/fixtures/requests/text-plain.json
```
When it should, instead, process all of those files.
Hướng dẫn đóng góp
Hướng nghiên cứu
Start with the CLI entry point at bin/httpsnippet and reproduce the failure using the glob command against src/fixtures/requests/*.json. Trace how arguments are parsed and how a single input is processed, then add CLI tests covering multiple globbed files and verify that each input produces an output instead of an unknown-arguments error.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- typescript
- Lĩnh vực
- cli, testing
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100