From b9961a916a1df65f72c0ac23872cd397ad1b8518 Mon Sep 17 00:00:00 2001 From: James Rodewig Date: Thu, 12 Dec 2024 12:54:38 -0500 Subject: [PATCH 1/3] Add examples for `fauna local` --- src/commands/local.mjs | 65 ++++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 24 deletions(-) diff --git a/src/commands/local.mjs b/src/commands/local.mjs index 5a3f7c84..a61c7284 100644 --- a/src/commands/local.mjs +++ b/src/commands/local.mjs @@ -22,34 +22,51 @@ async function startLocal(argv) { * @returns {import('yargs').Argv} The yargs instance */ function buildLocalCommand(yargs) { - return yargs.options({ - containerPort: { - describe: "The port inside the container Fauna listens on.", - type: "number", - default: "8443", - }, - hostPort: { - describe: - "The port on the host machine mapped to the container's port. This is the port you'll connect to Fauna on.", - type: "number", - default: "8443", - }, - name: { - describe: "The name to give the container", - type: "string", - default: "faunadb", - }, - pull: { - describe: "Pull the latest image before starting the container.", - type: "boolean", - default: true, - }, - }); + return yargs + .options({ + containerPort: { + describe: "The port inside the container Fauna listens on.", + type: "number", + default: "8443", + }, + hostPort: { + describe: + "The port on the host machine mapped to the container's port. This is the port you'll connect to Fauna on.", + type: "number", + default: "8443", + }, + name: { + describe: "Name for the container.", + type: "string", + default: "faunadb", + }, + pull: { + describe: + "Pull the latest image before starting the container. Use --no-pull to disable.", + type: "boolean", + default: true, + }, + }) + .example([ + [ + "$0 local", + "Start a local Fauna container with default name and ports.", + ], + ["$0 local --name local-fauna", "Start a container named 'local-fauna'."], + [ + "$0 local -hostPort 1234 --containerPort 6789", + "Map host port '1234' to container port '6789'. Equivalent to '-p 1234:6789' in Docker.", + ], + [ + "$0 local --no-pull", + "Don't pull the latest image before starting the container.", + ], + ]); } export default { command: "local", - describe: "Start a local Fauna container", + describe: "Start a local Fauna container.", builder: buildLocalCommand, handler: startLocal, }; From 08d26164a31296503deff5c02a7af0f6ae2369b9 Mon Sep 17 00:00:00 2001 From: James Rodewig Date: Thu, 12 Dec 2024 13:00:16 -0500 Subject: [PATCH 2/3] Fix typos --- src/commands/local.mjs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/commands/local.mjs b/src/commands/local.mjs index a61c7284..b2b81ab7 100644 --- a/src/commands/local.mjs +++ b/src/commands/local.mjs @@ -48,14 +48,11 @@ function buildLocalCommand(yargs) { }, }) .example([ - [ - "$0 local", - "Start a local Fauna container with default name and ports.", - ], + ["$0 local", "Start a Fauna container with default name and ports."], ["$0 local --name local-fauna", "Start a container named 'local-fauna'."], [ "$0 local -hostPort 1234 --containerPort 6789", - "Map host port '1234' to container port '6789'. Equivalent to '-p 1234:6789' in Docker.", + "Map host port '1234' to container port '6789'. Equivalent to '-p 1234:6789' in Docker.", ], [ "$0 local --no-pull", From d07416d16da6e49277a4d3274fb012d64ad1276d Mon Sep 17 00:00:00 2001 From: James Rodewig Date: Fri, 13 Dec 2024 14:25:02 -0500 Subject: [PATCH 3/3] Add period --- src/commands/local.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/local.mjs b/src/commands/local.mjs index 367dd829..99910b8f 100644 --- a/src/commands/local.mjs +++ b/src/commands/local.mjs @@ -81,7 +81,8 @@ function buildLocalCommand(yargs) { ); } return true; - }).example([ + }) + .example([ ["$0 local", "Start a Fauna container with default name and ports."], ["$0 local --name local-fauna", "Start a container named 'local-fauna'."], [ @@ -97,7 +98,7 @@ function buildLocalCommand(yargs) { export default { command: "local", - describe: "Start a local Fauna container", + describe: "Start a local Fauna container.", builder: buildLocalCommand, handler: startLocal, };