diff --git a/src/bin/vip-cache-purge-url.js b/src/bin/vip-cache-purge-url.js index d47d08517..ea8c75c45 100755 --- a/src/bin/vip-cache-purge-url.js +++ b/src/bin/vip-cache-purge-url.js @@ -6,14 +6,20 @@ import * as exit from '../lib/cli/exit'; import { readFromFile } from '../lib/read-file'; import { trackEvent } from '../lib/tracker'; +const usage = 'vip cache purge-url'; +const exampleUsage = 'vip @example-app.develop cache purge-url'; + const examples = [ { - usage: 'vip cache purge-url ', - description: 'Purge a URL from page cache', + usage: + `${ exampleUsage } https://example-app-develop.go-vip.co/sample-page/` + + '\n - Purged URL: https://example-app.develop.go-vip.co/sample-page/', + description: 'Purge the page cache for a single URL.', }, { - usage: 'vip cache purge-url --from-file=/dev/vip/urls.txt', - description: 'Purge multiple URLs from page cache', + usage: `${ exampleUsage } --from-file=./urls.txt`, + description: + 'Purge the page cache for multiple URLs, each listed on a single line in a local file.', }, ]; @@ -64,8 +70,8 @@ command( { appQuery, envContext: true, wildcardCommand: true, - usage: 'vip cache purge-url ', + usage, } ) - .option( 'from-file', 'Read URLs from file (useful to purge multiple URLs)' ) + .option( 'from-file', 'Read one or more URLs from a file, each listed on a single line.' ) .examples( examples ) .argv( process.argv, cachePurgeCommand ); diff --git a/src/bin/vip-cache.js b/src/bin/vip-cache.js index 3379ef733..661e7b764 100755 --- a/src/bin/vip-cache.js +++ b/src/bin/vip-cache.js @@ -2,8 +2,27 @@ import command from '../lib/cli/command'; +const usage = 'vip cache'; +const exampleUsage = 'vip @example-app.develop cache'; + +const examples = [ + { + usage: + `${ exampleUsage } purge-url https://example-app-develop.go-vip.co/sample-page/` + + '\n - Purged URL: https://example-app.develop.go-vip.co/sample-page/', + description: 'Purge the page cache for a single URL.', + }, + { + usage: `${ exampleUsage } purge-url --from-file=./urls.txt`, + description: + 'Purge the page cache for multiple URLs, each listed on a single line in a local file.', + }, +]; + command( { requiredArgs: 1, + usage, } ) - .command( 'purge-url', 'Purge page cache' ) + .command( 'purge-url', 'Purge page cache for one or more URLs.' ) + .examples( examples ) .argv( process.argv ); diff --git a/src/bin/vip.js b/src/bin/vip.js index 35a4854fb..73c0b1076 100755 --- a/src/bin/vip.js +++ b/src/bin/vip.js @@ -28,7 +28,7 @@ const runCmd = async function () { .command( 'logout', 'Log out the current authenticated VIP-CLI user.' ) .command( 'app', 'List and modify your VIP applications' ) .command( 'backup', 'Generate a backup of an environment.' ) - .command( 'cache', 'Manage page cache for your VIP applications' ) + .command( 'cache', 'Manage page cache for an environment.' ) .command( 'config', 'Manage environment configurations.' ) .command( 'dev-env', 'Create and manage VIP Local Development Environments.' ) .command( 'export', 'Export a copy of data associated with an environment.' )