#include "navigation.hpp" #include "repo_tool_map.hpp" #include namespace rl { auto RepoLensToolMap::execute(arguments args) noexcept -> exit_code { if (args.size() != 1 || args[0].empty()) { std::cerr << "map: Usage: repo map (non-empty term)" << '\n'; return 2; } std::filesystem::path root; std::string error; std::vector lines; if (!repository_root(root, error) || !read_lines(root / "docs" / "PROJECTMAP.md", lines, error)) { std::cerr << "map: " << error << '\n'; return 2; } std::cout << map_sections(lines, args[0]); return 0; } } // namespace rl