Skip to content

Commit

Permalink
Updating descriptions for command options
Browse files Browse the repository at this point in the history
  • Loading branch information
yolih committed Jun 6, 2024
1 parent 264f082 commit 2bce08b
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/bin/vip-config-software-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const cmd = command( {
wildcardCommand: true,
usage,
} ).examples( examples );
cmd.option( 'yes', 'Auto-confirm update' );
cmd.option( 'yes', 'Skip the confirmation prompt and automatically submit "y".' );
cmd.argv( process.argv, async ( arg, opt ) => {
const { app, env } = opt;
const { softwareSettings } = env;
Expand Down
2 changes: 1 addition & 1 deletion src/bin/vip-dev-env-create.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const cmd = command( {
undefined,
processSlug
)
.option( 'title', 'A descriptive value for the WordPress Site Title. Default is "VIP Dev").' )
.option( 'title', 'A descriptive value for the WordPress Site Title. Default is "VIP Dev".' )
.option(
'multisite',
'Create environment as a multisite. Accepts "y" for a subdomain multisite, "subdirectory" (recommended) for a subdirectory multisite, or "false". Default is "y".',
Expand Down
12 changes: 6 additions & 6 deletions src/bin/vip-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ command( {
let bail = false;

for ( const err of error.graphQLErrors ) {
if ( err.message !== 'Site is already syncing' ) {
if ( err.message !== 'Site is already syncing.' ) {
bail = true;
console.log( chalk.red( 'Error:' ), err.message );
}
Expand Down Expand Up @@ -92,10 +92,10 @@ command( {

if ( syncing ) {
if ( environment.syncProgress.status === 'running' ) {
console.log( chalk.yellow( 'Note:' ), 'A data sync is already running' );
console.log( chalk.yellow( 'Note:' ), 'A data sync is already running.' );
} else {
console.log( chalk.yellow( 'Note:' ), 'Someone recently ran a data sync on this site' );
console.log( chalk.yellow( 'Note:' ), 'Please wait a few minutes before trying again' );
console.log( chalk.yellow( 'Note:' ), 'Someone recently ran a data sync on this site.' );
console.log( chalk.yellow( 'Note:' ), 'Please wait a few minutes before trying again.' );
}
}

Expand Down Expand Up @@ -183,7 +183,7 @@ command( {
error: 'API returned `failed` status',
} );

out.push( `${ marks.failed } Data Sync is finished for ${ opts.app.name }` );
out.push( `${ marks.failed } Data Sync is finished for ${ opts.app.name }.` );
out.push( '' );
break;

Expand All @@ -193,7 +193,7 @@ command( {

await trackEvent( 'sync_command_success' );

out.push( `${ marks.success } Data Sync is finished for ${ opts.app.name }` );
out.push( `${ marks.success } Data Sync is finished for ${ opts.app.name }.` );
out.push( '' );
break;
}
Expand Down
32 changes: 24 additions & 8 deletions src/lib/cli/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ args.argv = async function ( argv, cb ) {
Boolean( options.exportFileErrorsToJson ) &&
! [ 'false', 'no' ].includes( options.exportFileErrorsToJson );
info.push( {
key: 'Export any file errors encountered to a JSON file instead of a plain text file',
key: 'Export any file errors encountered to a JSON file instead of a plain text file.',
value: options.exportFileErrorsToJson ? '✅ Yes' : `${ chalk.red( 'x' ) } No`,
} );
break;
Expand Down Expand Up @@ -566,25 +566,41 @@ export default function ( opts ) {
};

if ( _opts.appContext || _opts.requireConfirm ) {
args.option( 'app', 'Specify the app' );
args.option(
'app',
'Target an application. Accepts a string value for the application name or an integer for the application ID.'
);
}

if ( _opts.envContext || _opts.childEnvContext ) {
args.option( 'env', 'Specify the environment' );
args.option( 'env', 'Target an environment. Accepts a string value for the environment type.' );
}

if ( _opts.requireConfirm ) {
args.option( 'force', 'Skip confirmation', false );
args.option( 'force', 'Skip confirmation.', false );
}

if ( _opts.format ) {
args.option( 'format', 'Format results', 'table' );
args.option(
'format',
'Render output in a particular format. Accepts "table" (default), "csv", and "json".',
'table'
);
}

// Add help and version to all subcommands
args.option( 'help', 'Output the help for the (sub)command' );
args.option( 'version', 'Output the version number' );
args.option( 'debug', 'Activate debug output' );
args.option(
'help',
'Retrieve a description, examples, and available options for a (sub)command.'
);
args.option(
'version',
'Retrieve the version number of VIP-CLI currently installed on the local machine.'
);
args.option(
'debug',
'Generate verbose output during command execution to help identify or fix errors or bugs.'
);

return args;
}
Expand Down
40 changes: 29 additions & 11 deletions src/lib/dev-environment/dev-environment-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -830,43 +830,61 @@ export function processVersionOption( value: unknown ): string {
export function addDevEnvConfigurationOptions( command: Args ): Args {
// We leave the third parameter to undefined on some because the defaults are handled in preProcessInstanceData()
return command
.option( 'wordpress', 'Use a specific WordPress version', undefined, processVersionOption )
.option( [ 'u', 'mu-plugins' ], 'Use a specific mu-plugins changeset or local directory' )
.option(
'wordpress',
'Manage the version of WordPress. Accepts a string value for major versions (6.x). Defaults to the most recent version of WordPress.',
undefined,
processVersionOption
)
.option(
[ 'u', 'mu-plugins' ],
'Manage the source for VIP MU plugins. Accepts "demo" (default) for a read-only image of the staging branch, or a path to a built copy of VIP MU plugins on the local machine.'
)
.option(
'app-code',
'Use the application code from a local directory or use "demo" for VIP skeleton code'
'Manage the source for application code. Accepts "demo" (default) for a read-only image of WordPress skeleton code, or a path to a git cloned application repo on the local machine.'
)
.option(
'phpmyadmin',
'Enable PHPMyAdmin component. By default it is disabled',
'Manage PHPMyAdmin, disabled by default. Accepts "y" (default value) to enable or "n" to disable. When enabled, refer to the value of PHPMYADMIN URLS in the information output for a local environment for the URL to access phpMyAdmin.',
undefined,
processBooleanOption
)
.option(
'xdebug',
'Manage XDebug, disabled by default. Accepts "y" (default value) to enable or "n" to disable.',
undefined,
processBooleanOption
)
.option( 'xdebug', 'Enable XDebug. By default it is disabled', undefined, processBooleanOption )
.option(
'xdebug_config',
'Extra configuration to pass to xdebug via XDEBUG_CONFIG environment variable'
'Override some default configuration settings for Xdebug. Accepts a string value that is assigned to the XDEBUG_CONFIG environment variable.'
)
.option(
'elasticsearch',
'Enable Elasticsearch (needed by Enterprise Search)',
'Manage Elasticsearch (required by Enterprise Search), disabled by default. Accepts "y" (default value) to enable or "n" to disable.',
undefined,
processBooleanOption
)
.option(
[ 'r', 'media-redirect-domain' ],
'Domain to redirect for missing media files. This can be used to still have images without the need to import them locally.'
'Configure media files to be proxied from a VIP Platform environment. Accepts a string value for the primary domain of the VIP Platform environment or "n" to disable the media proxy.'
)
.option(
'php',
'Manage the version of PHP. Accepts a string value for minor versions (8.x). Defaults to the most recent version of PHP.',
undefined,
processVersionOption
)
.option( 'php', 'Explicitly choose PHP version to use', undefined, processVersionOption )
.option(
[ 'A', 'mailpit' ],
'Enable Mailpit. By default it is disabled',
'Manage Mailpit, disabled by default. Accepts "y" (default value) to enable or "n" to disable.',
undefined,
processBooleanOption
)
.option(
[ 'H', 'photon' ],
'Enable Photon. By default it is disabled',
'Manage Photon, disabled by default. Accepts "y" (default value) to enable or "n" to disable.',
undefined,
processBooleanOption
);
Expand Down

0 comments on commit 2bce08b

Please sign in to comment.