✨ Tweak yarg argument parsing (#438)
This commit is contained in:
committed by
ericlinagora
parent
7ff1faa0f3
commit
d562d1ad5f
@@ -128,7 +128,7 @@ class SearchIndexAll {
|
|||||||
options.spinner.succeed("Done!");
|
options.spinner.succeed("Done!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const reindexingArgumentGroupTitle = "Re-indexing options";
|
||||||
const repositoryArgumentName = "repository";
|
const repositoryArgumentName = "repository";
|
||||||
const command: yargs.CommandModule<unknown, unknown> = {
|
const command: yargs.CommandModule<unknown, unknown> = {
|
||||||
command: "index",
|
command: "index",
|
||||||
@@ -136,12 +136,16 @@ const command: yargs.CommandModule<unknown, unknown> = {
|
|||||||
builder: {
|
builder: {
|
||||||
[repositoryArgumentName]: {
|
[repositoryArgumentName]: {
|
||||||
type: "string",
|
type: "string",
|
||||||
description: `Repository name: ${SearchIndexAll.getSupportedRepoNames().join(", ")}`,
|
description: "Repository to re-index.",
|
||||||
|
choices: SearchIndexAll.getSupportedRepoNames(),
|
||||||
|
demandOption: true,
|
||||||
|
group: reindexingArgumentGroupTitle,
|
||||||
},
|
},
|
||||||
repairEntities: {
|
repairEntities: {
|
||||||
default: false,
|
default: false,
|
||||||
type: "boolean",
|
type: "boolean",
|
||||||
description: "Repair entities too when possible",
|
description: "Repair entities too when possible",
|
||||||
|
group: reindexingArgumentGroupTitle,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
handler: async argv => {
|
handler: async argv => {
|
||||||
|
|||||||
Reference in New Issue
Block a user