Skip to content

Commit

Permalink
fix: align wording around flag names (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
kruti49 committed Dec 21, 2022
1 parent 791bf6f commit 93433e6
Show file tree
Hide file tree
Showing 28 changed files with 62 additions and 60 deletions.
2 changes: 1 addition & 1 deletion src/commands/app-configs/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class AppConfigsDeploy extends MixCommand {
Use this command to deploy an application configuration. The configuration ID
can be retrieved using the app-configs:list command.
A specific environment-geography can be specified using the --env-geo flag.
A specific environment-geography can be specified using the 'env-geo' flag.
If none is specified, the application configuration will get deployed to the
next environment-geography defined in the deployment flow specified when
the application configuration was created.
Expand Down
2 changes: 1 addition & 1 deletion src/commands/app-configs/destroy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class AppConfigsDestroy extends MixCommand {
Use this command to permanently delete an application configuration.
The deletion needs to be confirmed by re-typing the application configuration
ID when prompted. It can also be pre-confirmed by using the --confirm flag.`
ID when prompted. It can also be pre-confirmed by using the 'confirm' flag.`

static flags = {
config: MixFlags.appConfigurationFlag,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/app-configs/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class AppConfigsGet extends MixCommand {
Use this command to get details about a particular application configuration.
The configuration ID can be retrieved using the app-configs:list command.
Use the --json or --yaml flag to get the full details as the human-readable
Use the 'json' or 'yaml' flag to get the full details as the human-readable
output is brief.`

static examples = [
Expand Down
2 changes: 1 addition & 1 deletion src/commands/bot-interfaces/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ See https://docs.nuance.com/mix/apis/mix-api/v4/reference/bots/ for details.`
this.log(`${transformedData.variables.length} variable${s(transformedData.variables.length)} `)
this.log(`${transformedData.transferNodes.length} transfer node${s(transformedData.transferNodes.length)}`)
this.log()
this.log('Use this command with the `json` flag to get the complete interface.')
this.log("Use this command with the 'json' flag to get the complete interface.")
this.log('Use the bot-interfaces:export command to export the interface to a JSON file.')
}

Expand Down
6 changes: 3 additions & 3 deletions src/commands/builds/destroy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using the build label or the combination of project ID, build type and build
version.
The deletion needs to be confirmed by re-typing the build label when prompted.
It can also be pre-confirmed by using the --confirm flag.`
It can also be pre-confirmed by using the 'confirm' flag.`

static examples = [
'Destroy a build',
Expand Down Expand Up @@ -96,8 +96,8 @@ It can also be pre-confirmed by using the --confirm flag.`
OR by the combination of its build type, project ID and build version.`,
{
suggestions: [
'Set --build-label flag OR ...',
'Set --project, --build-type AND -–build-version flags.',
"Set 'build-label' flag OR ...",
"Set 'project', 'build-type' AND 'build-version' flags.",
],
})
}
Expand Down
4 changes: 2 additions & 2 deletions src/commands/channels/configure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ teal yellow
${chalk.bold('IMPORTANT:')} Due to a current server-side limitation,
the command currently requires that both the
--mode and --color flags are set.`
'mode' and 'color' flags are set.`

static examples = [
'mix channels:configure -P 1922 \\',
Expand Down Expand Up @@ -83,7 +83,7 @@ the command currently requires that both the

// At least one flag must be set
if (options.mode === undefined && options.color === undefined) {
this.error('At least one of --mode and --color must be set.')
this.error("At least one of flag 'mode' and flag 'color' must be set.")
}

if (options.color !== undefined) {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/channels/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ richtext
tts
Note that, for your convenience, this command will automatically convert
inputs to the --mode flag as close to the format of the above modes as possible,
inputs to the 'mode' flag as close to the format of the above modes as possible,
by converting upper-case letters to lower-case and removing deliminating punctuation
('-' and '_'). So, the modes 'audioscript', 'AUDIO-SCRIPT', and 'a_u-d_i-o----scriPT'
are all equivalent to the server-side value of 'AUDIO_SCRIPT'.
Expand All @@ -55,7 +55,7 @@ teal yellow
${chalk.bold('IMPORTANT:')} Due to a current server-side limitation,
the command currently requires that both the
--mode and --color flags are set.`
'mode' and 'color' flags are set.`

static examples = [
`mix channels:create -P 1922 --name "New IVR channel" \\
Expand Down
4 changes: 2 additions & 2 deletions src/commands/data-hosts/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ retrieved using the applications:list command.`
For this comamnd, build type is assumed to be "dialog" as data hosts
are relevant to dialog builds only.`,
[
'Set --build-label flag OR ...',
'Set --project AND -–build-version flags.',
"Set 'build-label' flag OR ...",
"Set 'project' AND 'build-version' flags.",
]))
}
}
4 changes: 2 additions & 2 deletions src/commands/entities/configure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ are common to all entity types. However, certain attributes apply
to specific entity types only.
Regex entities make use of regular expressions specific to a single
locale. The --pattern and --locale flags matter only to entities
locale. The 'pattern' and 'locale' flags matter only to entities
of type "regex". It is recommended to surround the pattern
value with quotes, especially if the escape character "\\" is used
in the pattern. See examples below.
Relationial entities can have zero or one isA relation and
zero or many hasA relations. One --is-A or --has-A flag must be
zero or many hasA relations. One 'is-a' or 'has-a' flag must be
set at a minimum for an entity of type "relational".
The examples below show how to configure each type of entity.
Expand Down
4 changes: 2 additions & 2 deletions src/commands/entities/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ entity type, you will have to provide additional information as
explained below.
Regex entities make use of regular expressions specific to a single
locale. Use the --pattern flag to provide the regular expression for
locale. Use the 'pattern' flag to provide the regular expression for
the converted entity. It is recommended to surround the pattern value
with quotes, especially if the escape character "\\" is used in the
pattern (see examples below). The regular expression provided gets
Expand All @@ -39,7 +39,7 @@ expression for the entity is locale-dependent, then use the entities:configure
command to update the regular expression for the relevant locales.
Relational entities can have zero or one isA relation and
zero or many hasA relations. One --is-A or --has-A flag must be
zero or many hasA relations. One 'is-a' or 'has-a' flag must be
set at a minimum whent converting an entity to the "relational" type.
The examples below show how to convert an entity to each possible
Expand Down
6 changes: 3 additions & 3 deletions src/commands/entities/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ these attributes are common to all entity types. However, certain
attributes are mandatory and apply to specific entity types only.
Regex entities make use of regular expressions specific to a single
locale. The --pattern and --locale flags must be set when creating
locale. The 'pattern' and 'locale' flags must be set when creating
an entity of type "regex". It is recommended to surround the pattern
value with quotes, especially if the escape character "\\" is used
in the pattern. See examples below.
Relationial entities can have zero or one isA relation and
zero or many hasA relations. One --is-A or --has-A flag must be
zero or many hasA relations. One 'is-a' or 'has-a' flag must be
set at a minimum when creating an entity of type "relational".
The --entity-type, --name and --project flags are mandatory for
The 'entity-type', 'name' and 'project' flags are mandatory for
the creation of any entity type.
The examples below show how to create each type of entity.
Expand Down
2 changes: 1 addition & 1 deletion src/commands/entities/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ varies with the type of the entity queried. However, the CSV output provides a
column for each of the properties present in the superset of all entity type
properties. This way, a consistent set of columns is always presented.
Use the --json or --yaml flag to see the original data returned by the
Use the 'json' or 'yaml' flag to see the original data returned by the
server.
`

Expand Down
3 changes: 2 additions & 1 deletion src/commands/jobs/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ Use this command to get details about a particular job.`

if (isSomeFailed) {
this.outputCLITable(reportsData, {...this.reportsColumns, ...this.reportsErrorsColumn})
this.log('\nRun the command again with the --json flag to see error details for reported failures.')
this.log()
this.log("Run the command again with the 'json' flag to see error details for reported failures.")
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/commands/literals/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export default class LiteralsImport extends MixCommand {
Use this command to import literal-value pairs into a project. By default, the
literal-value pairs are appended to the project in the specified locale. It is
also possible to completely replace literal-value pairs for the specified locale
by using the --replace flag.
by using the 'replace' flag.
The import needs to be confirmed by re-typing the entity name when prompted.
It can also be pre-confirmed by using the --confirm flag.`
It can also be pre-confirmed by using the 'confirm' flag.`

static examples = [
'Import entity literals by appending',
Expand Down
2 changes: 1 addition & 1 deletion src/commands/ontology/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Use this command to import an ontology into a specific project. The provided
ontology can only be appended to the existing ontology.
The import needs to be confirmed by re-typing the project ID when prompted.
It can also be pre-confirmed by using the --confirm flag.`
It can also be pre-confirmed by using the 'confirm' flag.`

static examples = [
'Import an ontology',
Expand Down
2 changes: 1 addition & 1 deletion src/commands/projects/configure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default class ProjectsConfigure extends MixCommand {
Use this command to update the data pack for a locale used in a project.
The operation is not carried out immediately. Instead, the Mix backend returns
a job ID that can be used to monitor progress. mix-cli outputs detailed
information on the created job when the --json flag is provided.
information on the created job when the 'json' flag is provided.
Note that you cannot add a new locale with this command.
`
Expand Down
10 changes: 5 additions & 5 deletions src/commands/projects/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ export default class ProjectsCreate extends MixCommand {
static description = `create a new project
Use this command to create a new project. Many parameters are needed to
create a project. In particular, channels and modes go hand in hand. A --channel
flag must be matched by a --modes flag. Use a comma-separated list (no spaces)
create a project. In particular, channels and modes go hand in hand. A 'channel'
flag must be matched by a 'modes' flag. Use a comma-separated list (no spaces)
of mode names to specify multiple modes for a channel.
Given the right user permissions, it is possible to specify an engine pack using
the --engine-pack flag.
the 'engine-pack' flag.
${chalk.bold('Nuance’s Child Data Policy')}
Nuance’s Child Data Policy is related to online services that are subject to
Expand All @@ -46,8 +46,8 @@ or product that is primarily directed to children under 16.
This acknowledgement must be completed for any projects that are intended
for use in the Nuance SaaS cloud.
To acknowledge such a project, use the --child-data-compliant flag and also
provide a description of your project using the --description flag.`
To acknowledge such a project, use the 'child-data-compliant' flag and also
provide a description of your project using the 'description' flag.`

static examples = [
'Create a project with one channel and two modes',
Expand Down
2 changes: 1 addition & 1 deletion src/commands/projects/destroy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Unless a backup exists, there is no way to restore a project that
has been destroyed.
The deletion needs to be confirmed by re-typing the project ID when prompted.
It can also be pre-confirmed by using the --confirm flag.`
It can also be pre-confirmed by using the 'confirm' flag.`

static examples = [
'Destroy a project',
Expand Down
2 changes: 1 addition & 1 deletion src/commands/projects/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ As such, the project package exported by regular users will not include
these files. Regular users may end up with an incomplete project after calling
this endpoint.
Use the --metadata-only flag to export the project metadata JSON file only.`
Use the 'metadata-only' flag to export the project metadata JSON file only.`

static examples = [
'Export the project package to a zip file',
Expand Down
2 changes: 1 addition & 1 deletion src/commands/projects/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default class ProjectGet extends MixCommand {
Use this command to get details about a particular project.
CSV output is available for this command but only for one section of project
information at a time. The chosen section is specifed using the --table flag.`
information at a time. The chosen section is specifed using the 'table' flag.`

static examples = ['mix projects:get -P 1922']

Expand Down
4 changes: 2 additions & 2 deletions src/commands/samples/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export default class SamplesImport extends MixCommand {
Use this command sample sentences into a project. By default, the samples
sentences are appended to the project in the specified locale. It is also
possible to completely replace sample sentences for the specified locale
by using the --replace flag.
by using the 'replace' flag.
The import needs to be confirmed by re-typing the intent name when prompted.
It can also be pre-confirmed by using the --confirm flag. Consider making
It can also be pre-confirmed by using the 'confirm' flag. Consider making
a project backup before using this command.`

static examples = [
Expand Down
2 changes: 1 addition & 1 deletion src/utils/base/mix-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ that configuration file swiftly.`)
this.log(`Item${s(count)} ${resultInformation} of ${chalk.cyan(totalSize)} shown.`)

if ((this.context?.get('totalSize') ?? 0) > (this.context?.get('count') ?? 1)) {
this.log(`Use the ${chalk.cyan('--limit')} and ${chalk.cyan('--offset')} flags to view other parts of the list.`)
this.log(`Use the ${chalk.cyan("'limit'")} and ${chalk.cyan("'offset'")} flags to view other parts of the list.`)
}
}

Expand Down
12 changes: 6 additions & 6 deletions src/utils/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const eDownloadFailed = (message: string) => {
suggestions: [
'Verify provided file path exists.',
'Verify permissions on provided file path.',
'Use --overwrite to overwrite an existing file.',
"Use flag 'overwrite' to overwrite an existing file.",
],
})
}
Expand Down Expand Up @@ -129,7 +129,7 @@ export const eInvalidColumn = (message?: string, suggestions?: string[]) => {
{
code: Codes.InvalidColumnError,
exit: 1,
suggestions: suggestions ? suggestions : ['verify the values passed to the --columns flag.'],
suggestions: suggestions ? suggestions : ["verify the values passed to the 'columns' flag."],
})
}

Expand Down Expand Up @@ -161,8 +161,8 @@ by the combination of its build type, project ID and build version.`,
{
code: Codes.NoBuildInfo,
exit: 1,
suggestions: suggestions ?? ['Set --build-label flag OR ...',
'Set --project, --build-type AND build-version flags.'], // default
suggestions: suggestions ?? ["Set 'build-label' flag OR ...",
"Set 'project', 'build-type' AND 'build-version' flags."], // default
})
}

Expand All @@ -179,11 +179,11 @@ export const eNotFound = (message?: string, suggestions?: string[]) => {
export const eNotConfirmed = (confirm: string, expected: string) => {
return new MixCLIError(
`Operation was not confirmed.
Value ${chalk.red(confirm)} supplied to --confirm flag does not match expected value ${chalk.cyan(expected)}. Aborting.`,
Value ${chalk.red(confirm)} supplied to 'confirm' flag does not match expected value ${chalk.cyan(expected)}. Aborting.`,
{
code: Codes.NotConfirmed,
exit: 1,
suggestions: ['check value supplied to --confirm flag and try again.'],
suggestions: ["check value supplied to 'confirm' flag and try again."],
})
}

Expand Down
8 changes: 4 additions & 4 deletions src/utils/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ export const projectWithDefaultFlag = flags.integer({
})

export const projectTableFlag = flags.string({
description: 'data table to output (with --csv only)',
description: "data table to output (with 'csv' flag only)",
dependsOn: ['csv'],
exclusive: ['json', 'yaml'],
options: ['channels', 'data-packs', 'project'],
Expand Down Expand Up @@ -433,18 +433,18 @@ export const tableFlags = (options: any) => {
})}
const columnsCSV = {columns: flags.string({
dependsOn: ['csv'],
description: 'only show provided columns (comma-separated) (with --csv only)',
description: "only show provided columns (comma-separated) (with 'csv' flag only)",
exclusive: ['extended', 'json', 'yaml'],
})}
const columnsTableCSV = {columns: flags.string({
dependsOn: ['csv', 'table'],
description: 'only show provided columns (comma-separated) (with --csv only)',
description: "only show provided columns (comma-separated) (with 'csv' flag only)",
exclusive: ['extended', 'json', 'yaml'],
})}
const tableCSV = {csv: flags.boolean({
dependsOn: ['table'],
exclusive: ['json', 'no-truncate', 'yaml'],
description: 'output to csv format (with --table only)',
description: "output to csv format (with 'table' flag only)",
})}

const csv = {csv: flags.boolean({exclusive: ['json', 'no-truncate', 'yaml'], description: 'output to csv format'})}
Expand Down
Loading

0 comments on commit 93433e6

Please sign in to comment.