MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / visible_subcommand_paths

Function visible_subcommand_paths

src/cli/parse_tests.rs:14–27  ·  view source on GitHub ↗
(command: &Command)

Source from the content-addressed store, hash-verified

12}
13
14fn visible_subcommand_paths(command: &Command) -> Vec<Vec<String>> {
15 fn collect(command: &Command, prefix: Vec<String>, paths: &mut Vec<Vec<String>>) {
16 for subcommand in command.get_subcommands().filter(|sub| !sub.is_hide_set()) {
17 let mut path = prefix.clone();
18 path.push(subcommand.get_name().to_string());
19 paths.push(path.clone());
20 collect(subcommand, path, paths);
21 }
22 }
23
24 let mut paths = Vec::new();
25 collect(command, Vec::new(), &mut paths);
26 paths
27}
28
29#[test]
30fn visible_subcommands_accept_clap_help() {

Calls 1

collectFunction · 0.70

Tested by

no test coverage detected