From d562d1ad5f0bbf8a3eafe336e46411732ff35631 Mon Sep 17 00:00:00 2001 From: Eric Doughty-Papassideris Date: Tue, 26 Mar 2024 12:06:22 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Tweak=20yarg=20argument=20parsing?= =?UTF-8?q?=20(#438)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tdrive/backend/node/src/cli/cmds/search_cmds/index_all.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tdrive/backend/node/src/cli/cmds/search_cmds/index_all.ts b/tdrive/backend/node/src/cli/cmds/search_cmds/index_all.ts index 1af66439..db69e532 100644 --- a/tdrive/backend/node/src/cli/cmds/search_cmds/index_all.ts +++ b/tdrive/backend/node/src/cli/cmds/search_cmds/index_all.ts @@ -128,7 +128,7 @@ class SearchIndexAll { options.spinner.succeed("Done!"); } } - +const reindexingArgumentGroupTitle = "Re-indexing options"; const repositoryArgumentName = "repository"; const command: yargs.CommandModule = { command: "index", @@ -136,12 +136,16 @@ const command: yargs.CommandModule = { builder: { [repositoryArgumentName]: { type: "string", - description: `Repository name: ${SearchIndexAll.getSupportedRepoNames().join(", ")}`, + description: "Repository to re-index.", + choices: SearchIndexAll.getSupportedRepoNames(), + demandOption: true, + group: reindexingArgumentGroupTitle, }, repairEntities: { default: false, type: "boolean", description: "Repair entities too when possible", + group: reindexingArgumentGroupTitle, }, }, handler: async argv => {