Skip to content

Commit ff2f8d6

Browse files
committed
feat(cli): improve profile command clarity with --type flag
BREAKING CHANGE: Changed --deployment flag to --type for profile set command - Renamed --deployment to --type for better clarity (cloud vs enterprise) - Added --deployment as a visible alias for backward compatibility - Updated all help text examples to use --type consistently - Changed help text from 'Deployment type' to 'Platform type: cloud or enterprise' - Fixed incorrect examples that showed positional argument syntax The --type flag more clearly indicates this is selecting between Redis Cloud and Redis Enterprise platforms, reducing confusion with deployment environments. The --deployment alias maintains backward compatibility for existing scripts.
1 parent 65c7032 commit ff2f8d6

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

crates/redisctl/src/cli.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ Redis management CLI for Cloud and Enterprise deployments
2020
2121
EXAMPLES:
2222
# Set up a Cloud profile
23-
redisctl profile set mycloud cloud --api-key KEY --api-secret SECRET
23+
redisctl profile set mycloud --type cloud --api-key KEY --api-secret SECRET
2424
2525
# Set up an Enterprise profile
26-
redisctl profile set myenterprise enterprise --url https://cluster:9443 --username admin
26+
redisctl profile set myenterprise --type enterprise --url https://cluster:9443 --username admin
2727
2828
# List databases
2929
redisctl cloud database list
@@ -102,7 +102,7 @@ pub enum Commands {
102102
redisctl api enterprise get /v1/bdbs -o json
103103
")]
104104
Api {
105-
/// Deployment type to target
105+
/// Platform type (cloud or enterprise)
106106
#[arg(value_enum)]
107107
deployment: DeploymentType,
108108

@@ -122,10 +122,10 @@ pub enum Commands {
122122
#[command(subcommand, visible_alias = "prof", visible_alias = "pr")]
123123
#[command(after_help = "EXAMPLES:
124124
# Create a Cloud profile
125-
redisctl profile set mycloud cloud --api-key KEY --api-secret SECRET
125+
redisctl profile set mycloud --type cloud --api-key KEY --api-secret SECRET
126126
127127
# Create an Enterprise profile
128-
redisctl profile set myenterprise enterprise --url https://cluster:9443 --username admin
128+
redisctl profile set myenterprise --type enterprise --url https://cluster:9443 --username admin
129129
130130
# List all profiles
131131
redisctl profile list
@@ -242,23 +242,23 @@ pub enum ProfileCommands {
242242
#[command(visible_alias = "add", visible_alias = "create")]
243243
#[command(after_help = "EXAMPLES:
244244
# Create a Cloud profile
245-
redisctl profile set mycloud cloud \\
245+
redisctl profile set mycloud --type cloud \\
246246
--api-key A3qcymrvqpn9rrgdt40sv5f9yfxob26vx64hwddh8vminqnkgfq \\
247247
--api-secret S3s8ecrrnaguqkvwfvealoe3sn25zqs4wc4lwgo4rb0ud3qm77c
248248
249249
# Create an Enterprise profile (password will be prompted)
250-
redisctl profile set prod enterprise \\
250+
redisctl profile set prod --type enterprise \\
251251
--url https://cluster.example.com:9443 \\
252252
--username [email protected]
253253
254254
# Create Enterprise profile with password
255-
redisctl profile set staging enterprise \\
255+
redisctl profile set staging --type enterprise \\
256256
--url https://staging:9443 \\
257257
--username admin \\
258258
--password mypassword
259259
260260
# Create Enterprise profile allowing insecure connections
261-
redisctl profile set local enterprise \\
261+
redisctl profile set local --type enterprise \\
262262
--url https://localhost:9443 \\
263263
--username [email protected] \\
264264
--insecure
@@ -267,28 +267,28 @@ pub enum ProfileCommands {
267267
/// Profile name
268268
name: String,
269269

270-
/// Deployment type
271-
#[arg(long, value_enum)]
272-
deployment: DeploymentType,
270+
/// Platform type: 'cloud' for Redis Cloud or 'enterprise' for Redis Enterprise
271+
#[arg(long, value_enum, visible_alias = "deployment")]
272+
r#type: DeploymentType,
273273

274274
/// API key (for Cloud profiles)
275-
#[arg(long, required_if_eq("deployment", "cloud"))]
275+
#[arg(long, required_if_eq("type", "cloud"))]
276276
api_key: Option<String>,
277277

278278
/// API secret (for Cloud profiles)
279-
#[arg(long, required_if_eq("deployment", "cloud"))]
279+
#[arg(long, required_if_eq("type", "cloud"))]
280280
api_secret: Option<String>,
281281

282282
/// API URL (for Cloud profiles)
283283
#[arg(long, default_value = "https://api.redislabs.com/v1")]
284284
api_url: String,
285285

286286
/// Enterprise URL (for Enterprise profiles)
287-
#[arg(long, required_if_eq("deployment", "enterprise"))]
287+
#[arg(long, required_if_eq("type", "enterprise"))]
288288
url: Option<String>,
289289

290290
/// Username (for Enterprise profiles)
291-
#[arg(long, required_if_eq("deployment", "enterprise"))]
291+
#[arg(long, required_if_eq("type", "enterprise"))]
292292
username: Option<String>,
293293

294294
/// Password (for Enterprise profiles)

crates/redisctl/src/commands/profile.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub async fn handle_profile_command(
2424
Show { name } => handle_show(conn_mgr, name, output_format).await,
2525
Set {
2626
name,
27-
deployment,
27+
r#type,
2828
api_key,
2929
api_secret,
3030
api_url,
@@ -38,7 +38,7 @@ pub async fn handle_profile_command(
3838
handle_set(
3939
conn_mgr,
4040
name,
41-
deployment,
41+
r#type,
4242
api_key,
4343
api_secret,
4444
api_url,

0 commit comments

Comments
 (0)