remove: deprecated show command from CLI
The `show` command (`lore show issue 42` / `lore show mr 99`) was deprecated in favor of the unified entity commands (`lore issues 42` / `lore mrs 99`). This commit fully removes the command entry point: - Remove `Commands::Show` variant from clap CLI definition - Remove `Commands::Show` match arm and deprecation warning in main.rs - Remove `handle_show_compat()` forwarding function from robot_docs.rs - Remove "show" from autocorrect known-commands and flags tables - Rename response schema keys from "show" to "detail" in robot-docs - Update command descriptions from "List or show" to "List ... or view detail with <IID>" The underlying detail-view module (`src/cli/commands/show/`) is preserved — its types (IssueDetail, MrDetail) and query/render functions are still used by `handle_issues` and `handle_mrs` when an IID argument is provided.
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
bd-23xb
|
||||
bd-2i3z
|
||||
|
||||
@@ -115,7 +115,7 @@ fn handle_robot_docs(robot_mode: bool, brief: bool) -> Result<(), Box<dyn std::e
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"description": "List or show issues",
|
||||
"description": "List issues, or view detail with <IID>",
|
||||
"flags": ["<IID>", "-n/--limit", "--fields <list>", "-s/--state", "--status <name>", "-p/--project", "-a/--author", "-A/--assignee", "-l/--label", "-m/--milestone", "--since", "--due-before", "--has-due", "--no-has-due", "--sort", "--asc", "--no-asc", "-o/--open", "--no-open"],
|
||||
"example": "lore --robot issues --state opened --limit 10",
|
||||
"notes": {
|
||||
@@ -128,7 +128,7 @@ fn handle_robot_docs(robot_mode: bool, brief: bool) -> Result<(), Box<dyn std::e
|
||||
"data": {"issues": "[{iid:int, title:string, state:string, author_username:string, labels:[string], assignees:[string], discussion_count:int, unresolved_count:int, created_at_iso:string, updated_at_iso:string, web_url:string?, project_path:string, status_name:string?}]", "total_count": "int", "showing": "int"},
|
||||
"meta": {"elapsed_ms": "int", "available_statuses": "[string] — all distinct status names in the database, for use with --status filter"}
|
||||
},
|
||||
"show": {
|
||||
"detail": {
|
||||
"ok": "bool",
|
||||
"data": "IssueDetail (full entity with description, discussions, notes, events)",
|
||||
"meta": {"elapsed_ms": "int"}
|
||||
@@ -138,7 +138,7 @@ fn handle_robot_docs(robot_mode: bool, brief: bool) -> Result<(), Box<dyn std::e
|
||||
"fields_presets": {"minimal": ["iid", "title", "state", "updated_at_iso"]}
|
||||
},
|
||||
"mrs": {
|
||||
"description": "List or show merge requests",
|
||||
"description": "List merge requests, or view detail with <IID>",
|
||||
"flags": ["<IID>", "-n/--limit", "--fields <list>", "-s/--state", "-p/--project", "-a/--author", "-A/--assignee", "-r/--reviewer", "-l/--label", "--since", "-d/--draft", "-D/--no-draft", "--target", "--source", "--sort", "--asc", "--no-asc", "-o/--open", "--no-open"],
|
||||
"example": "lore --robot mrs --state opened",
|
||||
"response_schema": {
|
||||
@@ -147,7 +147,7 @@ fn handle_robot_docs(robot_mode: bool, brief: bool) -> Result<(), Box<dyn std::e
|
||||
"data": {"mrs": "[{iid:int, title:string, state:string, author_username:string, labels:[string], draft:bool, target_branch:string, source_branch:string, discussion_count:int, unresolved_count:int, created_at_iso:string, updated_at_iso:string, web_url:string?, project_path:string, reviewers:[string]}]", "total_count": "int", "showing": "int"},
|
||||
"meta": {"elapsed_ms": "int"}
|
||||
},
|
||||
"show": {
|
||||
"detail": {
|
||||
"ok": "bool",
|
||||
"data": "MrDetail (full entity with description, discussions, notes, events)",
|
||||
"meta": {"elapsed_ms": "int"}
|
||||
@@ -780,42 +780,3 @@ async fn handle_list_compat(
|
||||
}
|
||||
}
|
||||
|
||||
async fn handle_show_compat(
|
||||
config_override: Option<&str>,
|
||||
entity: &str,
|
||||
iid: i64,
|
||||
project_filter: Option<&str>,
|
||||
robot_mode: bool,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
let start = std::time::Instant::now();
|
||||
let config = Config::load(config_override)?;
|
||||
let project_filter = config.effective_project(project_filter);
|
||||
|
||||
match entity {
|
||||
"issue" => {
|
||||
let result = run_show_issue(&config, iid, project_filter)?;
|
||||
if robot_mode {
|
||||
print_show_issue_json(&result, start.elapsed().as_millis() as u64);
|
||||
} else {
|
||||
print_show_issue(&result);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
"mr" => {
|
||||
let result = run_show_mr(&config, iid, project_filter)?;
|
||||
if robot_mode {
|
||||
print_show_mr_json(&result, start.elapsed().as_millis() as u64);
|
||||
} else {
|
||||
print_show_mr(&result);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
_ => {
|
||||
eprintln!(
|
||||
"{}",
|
||||
Theme::error().render(&format!("Unknown entity: {entity}"))
|
||||
);
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,7 +290,6 @@ const COMMAND_FLAGS: &[(&str, &[&str])] = &[
|
||||
"--source-branch",
|
||||
],
|
||||
),
|
||||
("show", &["--project"]),
|
||||
("reset", &["--yes"]),
|
||||
(
|
||||
"me",
|
||||
@@ -396,7 +395,6 @@ const CANONICAL_SUBCOMMANDS: &[&str] = &[
|
||||
"backup",
|
||||
"reset",
|
||||
"list",
|
||||
"show",
|
||||
"auth-test",
|
||||
"sync-status",
|
||||
];
|
||||
|
||||
@@ -381,17 +381,6 @@ pub enum Commands {
|
||||
source_branch: Option<String>,
|
||||
},
|
||||
|
||||
#[command(hide = true)]
|
||||
Show {
|
||||
#[arg(value_parser = ["issue", "mr"])]
|
||||
entity: String,
|
||||
|
||||
iid: i64,
|
||||
|
||||
#[arg(long)]
|
||||
project: Option<String>,
|
||||
},
|
||||
|
||||
#[command(hide = true, name = "auth-test")]
|
||||
AuthTest,
|
||||
|
||||
|
||||
27
src/main.rs
27
src/main.rs
@@ -365,33 +365,6 @@ fn main() {
|
||||
)
|
||||
.await
|
||||
}
|
||||
Some(Commands::Show {
|
||||
entity,
|
||||
iid,
|
||||
project,
|
||||
}) => {
|
||||
if robot_mode {
|
||||
eprintln!(
|
||||
r#"{{"warning":{{"type":"DEPRECATED","message":"'lore show' is deprecated, use 'lore {entity}s {iid}'","successor":"{entity}s"}}}}"#
|
||||
);
|
||||
} else {
|
||||
eprintln!(
|
||||
"{}",
|
||||
Theme::warning().render(&format!(
|
||||
"warning: 'lore show' is deprecated, use 'lore {}s {}'",
|
||||
entity, iid
|
||||
))
|
||||
);
|
||||
}
|
||||
handle_show_compat(
|
||||
cli.config.as_deref(),
|
||||
&entity,
|
||||
iid,
|
||||
project.as_deref(),
|
||||
robot_mode,
|
||||
)
|
||||
.await
|
||||
}
|
||||
Some(Commands::AuthTest) => {
|
||||
if robot_mode {
|
||||
eprintln!(
|
||||
|
||||
Reference in New Issue
Block a user