Skip to content

Commit b694a30

Browse files
committed
Fix missed parameter renaming in error messages
1 parent 5205dac commit b694a30

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

wp_rs_cli/src/bin/wp_rs_cli/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,13 +418,13 @@ async fn resolve_post_id(client: &WpApiClient, args: &FetchPostArgs) -> Result<P
418418
return Ok(id);
419419
}
420420
let Some(post_url) = &args.url else {
421-
return Err(anyhow!("Either --post-id or --post-url must be provided"));
421+
return Err(anyhow!("Either --post-id or --url must be provided"));
422422
};
423423

424424
// Strategy: retrieve by slug via posts list API when possible.
425425
// For wp.com, the resolver requires site context; for wp.org, api_root is given.
426426
// We'll try to parse the URL and extract a last path segment as potential slug.
427-
let url = Url::parse(post_url).map_err(|e| anyhow!("Invalid --post-url: {e}"))?;
427+
let url = Url::parse(post_url).map_err(|e| anyhow!("Invalid url: {e}"))?;
428428
let slug_candidate = url
429429
.path_segments()
430430
.and_then(|segs| segs.filter(|s| !s.is_empty()).last())
@@ -433,7 +433,7 @@ async fn resolve_post_id(client: &WpApiClient, args: &FetchPostArgs) -> Result<P
433433
.to_string();
434434

435435
if slug_candidate.is_empty() {
436-
return Err(anyhow!("Could not parse a slug from --post-url"));
436+
return Err(anyhow!("Could not parse a slug from url"));
437437
}
438438

439439
// Query posts by slug; returns an array, take first match.

0 commit comments

Comments
 (0)