summaryrefslogtreecommitdiff
path: root/cli/main.rs
diff options
context:
space:
mode:
authoruki00a <uki00a@gmail.com>2020-06-09 21:12:47 +0900
committerGitHub <noreply@github.com>2020-06-09 14:12:47 +0200
commit2b2d800b43e548e615abef80278d20dda5ae7d42 (patch)
tree3fadab0dbce29b7ce98f08a43fb3ca0bed2924bb /cli/main.rs
parentb3e189ee4f97a9d6c5b7a2164d644aa4c7fa4b79 (diff)
feat(doc): display all overloads in cli details view (#6186)
Diffstat (limited to 'cli/main.rs')
-rw-r--r--cli/main.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/cli/main.rs b/cli/main.rs
index 3c16df974..909295439 100644
--- a/cli/main.rs
+++ b/cli/main.rs
@@ -578,13 +578,17 @@ async fn doc_command(
serde_json::to_writer_pretty(writer, &doc_nodes).map_err(ErrBox::from)
} else {
let details = if let Some(filter) = maybe_filter {
- let node = doc::find_node_by_name_recursively(doc_nodes, filter.clone());
- if let Some(node) = node {
- doc::printer::format_details(node)
- } else {
+ let nodes =
+ doc::find_nodes_by_name_recursively(doc_nodes, filter.clone());
+ if nodes.is_empty() {
eprintln!("Node {} was not found!", filter);
std::process::exit(1);
}
+ let mut details = String::new();
+ for node in nodes {
+ details.push_str(doc::printer::format_details(node).as_str());
+ }
+ details
} else {
doc::printer::format(doc_nodes)
};