Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the export command group according to VIP-CLI style guide #1741

Merged
merged 4 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions src/bin/vip-export-sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@ import { makeCommandTracker } from '../lib/tracker';

const examples = [
{
usage: 'vip export sql @mysite.develop',
description: 'Export SQL file from your site and save it to the current directory',
usage: 'vip @example-app.develop export sql',
description:
'Download an archived copy of the most recent database backup for an environment to the current local directory.',
},
{
usage: 'vip export sql @mysite.develop --output=~/Desktop/export.sql.gz',
description: 'The output file can be specified with the --output flag',
usage: 'vip @example-app.develop export sql --output=~/Desktop/export.sql.gz',
description:
'Download an archived copy of the most recent database backup for an environment to a specific file path.',
},
{
usage: 'vip @example-app.develop export sql --generate-backup',
description:
'Generate a fresh database backup for an environment and download a copy of that backup.',
},
];

Expand All @@ -38,11 +45,11 @@ command( {
requiredArgs: 0,
usage: 'vip export sql',
} )
.option( 'output', 'Specify the location where you want to save the export file' )
.option(
'generate-backup',
'Exports a freshly created database backup instead of using the latest existing one'
'output',
'Download the file to a specific local directory path with a custom file name.'
)
.option( 'generate-backup', 'Generate a fresh database backup and export a copy of that backup.' )
.examples( examples )
.argv( process.argv, async ( arg, { app, env, output, generateBackup } ) => {
const trackerFn = makeCommandTracker( 'export_sql', {
Expand Down
9 changes: 6 additions & 3 deletions src/bin/vip-export.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ import command from '../lib/cli/command';
import { trackEvent } from '../lib/tracker';

command()
.command( 'sql', 'Export the contents of your database to an SQL file' )
.command(
'sql',
'Generate a copy of a database backup for an environment and download it as an archived SQL file.'
)
.example(
'vip export sql @mysite.develop',
'Export the contents of your database to an SQL file'
'vip @example-app.develop export sql',
'Download a copy of the most recent database backup for an environment as an archived SQL file to the current local directory.'
)
.argv( process.argv, async () => {
await trackEvent( 'vip_export_command_execute' );
Expand Down
2 changes: 1 addition & 1 deletion src/bin/vip.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const runCmd = async function () {
.command( 'cache', 'Manage page cache for your VIP applications' )
.command( 'config', 'Set configuration for your VIP applications' )
.command( 'dev-env', 'Use local dev-environment' )
.command( 'export', 'Export data from your VIP application' )
.command( 'export', 'Export a copy of data associated with an environment.' )
.command( 'import', 'Import media or SQL files into your VIP applications' )
.command( 'logs', 'Get logs from your VIP applications' )
.command( 'search-replace', 'Perform search and replace tasks on files' )
Expand Down