From 6b4e4cbd7c10a06d0ac3fa16cbc2f5bfe6f90292 Mon Sep 17 00:00:00 2001 From: Terri Ann Swallow Date: Thu, 13 Jun 2024 10:26:58 -0400 Subject: [PATCH 1/2] Updating descriptions and examples for vip cache commands --- src/bin/vip-cache-purge-url.js | 18 ++++++++++++------ src/bin/vip-cache.js | 21 ++++++++++++++++++++- src/bin/vip.js | 2 +- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/bin/vip-cache-purge-url.js b/src/bin/vip-cache-purge-url.js index d47d08517..8643c14ef 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 URLs from a file, can be used to purge multiple URLs.' ) .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.' ) From 9447de194054c8d14f1f8913bdb39e30d999f7c4 Mon Sep 17 00:00:00 2001 From: Terri Ann Swallow Date: Thu, 13 Jun 2024 15:53:56 -0400 Subject: [PATCH 2/2] Update option definition based on PR feedback. --- src/bin/vip-cache-purge-url.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/vip-cache-purge-url.js b/src/bin/vip-cache-purge-url.js index 8643c14ef..ea8c75c45 100755 --- a/src/bin/vip-cache-purge-url.js +++ b/src/bin/vip-cache-purge-url.js @@ -72,6 +72,6 @@ command( { wildcardCommand: true, usage, } ) - .option( 'from-file', 'Read URLs from a file, can be used 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 );