Skip to content

Commit cb4aa6b

Browse files
fixed command options
Commander expects -- before option names for long command names. It also does not support multiple long option names, like "--local" and "--noGenTestData" tj/commander.js#479
1 parent f0a87e6 commit cb4aa6b

File tree

5 files changed

+21
-11
lines changed

5 files changed

+21
-11
lines changed

packages/pages/src/build/build.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const buildCommand = (program: Command) => {
66
.command("build")
77
.description("Build site using Vite")
88
.option(
9-
"scope <string>",
9+
"--scope <string>",
1010
"The subfolder to scope the served templates from"
1111
)
1212
.action(async (options) => {

packages/pages/src/dev/dev.ts

+16-6
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,33 @@ export const devCommand = (program: Command) => {
1212
"Creates features.json, generates test data, " +
1313
"and runs a custom local development server that is backed by Vite."
1414
)
15-
.option("local, noGenTestData", "Disables dynamically generated test data")
1615
.option(
17-
"scope <string>",
16+
"--scope <string>",
1817
"The subfolder to scope the served templates from"
1918
)
19+
.option("--local", "Disables dynamically generated test data")
2020
.option(
21-
"prod-url",
21+
"--prod-url",
2222
"Use production URLs, instead of /[template-name]/[external-id]",
2323
true
2424
)
2525
.option(
26-
"open-browser",
26+
"--no-prod-url",
27+
"Use local URLs, such as /[template-name]/[external-id]",
28+
false
29+
)
30+
.option(
31+
"--open-browser",
2732
"Automatically opens the browser on server start-up",
2833
true
2934
)
30-
.option("noInit", "Disables automatic yext init with .yextrc file")
31-
.option("noGenFeatures", "Disable feature.json generation step")
35+
.option(
36+
"--no-open-browser",
37+
"Do not open the browser on server start-up",
38+
false
39+
)
40+
.option("--noInit", "Disables automatic yext init with .yextrc file")
41+
.option("--noGenFeatures", "Disable feature.json generation step")
3242
.action(async (options) => {
3343
if (!options.noInit) {
3444
await autoYextInit();

packages/pages/src/generate/ci/ci.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const ciCommand = (program: Command) => {
1212
.command("ci")
1313
.description("Generates ci.json file")
1414
.option(
15-
"scope <string>",
15+
"--scope <string>",
1616
"The subfolder to scope the served templates from"
1717
)
1818
.action((options, command) => {

packages/pages/src/generate/features/features.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const featureCommand = (program: Command) => {
1111
.command("features")
1212
.description("Generates features.json file")
1313
.option(
14-
"scope <string>",
14+
"--scope <string>",
1515
"The subfolder to scope the served templates from"
1616
)
1717
.action(async (options, command) => {

packages/pages/src/prod/prod.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ export const prodCommand = (program: Command) => {
55
program
66
.command("prod")
77
.description("Runs a custom local production server")
8-
.option("noBuild", "Disable build step")
9-
.option("noRender", "Disable render step")
8+
.option("--noBuild", "Disable build step")
9+
.option("--noRender", "Disable render step")
1010
.action(async (options) => {
1111
const commandName = "yext pages";
1212
if (!options.noBuild) await runSubprocess(commandName, ["build"]);

0 commit comments

Comments
 (0)