fix(importer-curl): read combined short flags as separate options (#577)

This commit is contained in:
Ngo Quoc Viet
2026-08-18 09:09:04 -07:00
committed by GitHub
parent 69083918f9
commit 131b7e5ab1
2 changed files with 74 additions and 9 deletions
+30
View File
@@ -16,6 +16,36 @@ describe("importer-curl", () => {
});
});
// A short cluster is one option per character until one that takes a value.
// `-fsSL` is four boolean flags, so nothing in it is a positional argument --
// the URL used to come out as "sSL".
test("Imports combined short flags", () => {
expect(convertCurl("curl -fsSL https://yaak.app")).toEqual({
resources: {
workspaces: [baseWorkspace()],
httpRequests: [
baseRequest({
url: "https://yaak.app",
}),
],
},
});
});
test("Imports a combined short cluster ending in a value flag", () => {
expect(convertCurl("curl -sSXPOST https://yaak.app")).toEqual({
resources: {
workspaces: [baseWorkspace()],
httpRequests: [
baseRequest({
url: "https://yaak.app",
method: "POST",
}),
],
},
});
});
test("Explicit URL", () => {
expect(convertCurl("curl --url https://yaak.app")).toEqual({
resources: {