diff --git a/bin/iabc.js b/bin/iabc.js new file mode 100644 index 0000000..72323b0 --- /dev/null +++ b/bin/iabc.js @@ -0,0 +1,21 @@ +#!/usr/bin/env node +import make from '../src/cli/make.js'; +import create from '../src/cli/curl-route-builder.js'; + +// Retrieve command-line arguments +const args = process.argv.slice(2); +const command = args[0]; + +if (command === undefined) { + make(process.argv, process.cwd(),); +} +else { + if (command === "curl" || command === "har" || command === "open-api"){ + create(process.argv, process.cwd(),); + } + else { + throw new Error("unknown command: " + command); + } +} + + diff --git a/package.json b/package.json index f1cbb8c..edbe447 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,8 @@ "iabgbfh": "bin/generate-benchmark-from-har.js", "iabmp": "bin/make-benchmark-project.js", "iabgfoa": "bin/generate-benchmark-from-open-api.js", - "iabgbfc": "bin/generate-benchmark-from-curl.js" + "iabgbfc": "bin/generate-benchmark-from-curl.js", + "iabc": "bin/iabc.js" }, "scripts": { "lint": "eslint . --ext .js,.ts,.cjs,.json,.tsx",