{"action":"created","issue":{"url":"https://api.github.com/repos/BurntSushi/ripgrep/issues/216","repository_url":"https://api.github.com/repos/BurntSushi/ripgrep","labels_url":"https://api.github.com/repos/BurntSushi/ripgrep/issues/216/labels{/name}","comments_url":"https://api.github.com/repos/BurntSushi/ripgrep/issues/216/comments","events_url":"https://api.github.com/repos/BurntSushi/ripgrep/issues/216/events","html_url":"https://github.com/BurntSushi/ripgrep/issues/216","id":187066811,"number":216,"title":"Get number of matched entries for each directory","user":{"login":"jacwah","id":3816754,"avatar_url":"https://avatars.githubusercontent.com/u/3816754?v=3","gravatar_id":"","url":"https://api.github.com/users/jacwah","html_url":"https://github.com/jacwah","followers_url":"https://api.github.com/users/jacwah/followers","following_url":"https://api.github.com/users/jacwah/following{/other_user}","gists_url":"https://api.github.com/users/jacwah/gists{/gist_id}","starred_url":"https://api.github.com/users/jacwah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacwah/subscriptions","organizations_url":"https://api.github.com/users/jacwah/orgs","repos_url":"https://api.github.com/users/jacwah/repos","events_url":"https://api.github.com/users/jacwah/events{/privacy}","received_events_url":"https://api.github.com/users/jacwah/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-11-03T13:57:44Z","updated_at":"2016-11-03T15:08:30Z","closed_at":null,"body":"I'm creating a `tree`-like utility (https://github.com/jacwah/ntree) and the `ignore` crate seems really useful for implementing it. There is however an issue: to render the tree, the program needs to know the number of matched entries in each directory, or at least somehow query `Walk` for each entry to see if there are more entries left in the same directory.\r\n\r\nPseudocode examples below to illustrate what I mean:\r\n```\r\nfor entry in walk {\r\n    if entry.is_dir() {\r\n        process_dir(entry.path(), entry.get_num_entries());\r\n    }\r\n    // ...\r\n}\r\n\r\nfor entry in walk {\r\n    process_entry(entry.path(), entry.parent_has_more_entries();\r\n}\r\n\r\nfor entry in walk {\r\n    process_entry(entry.path(), entry.peek_next_sibling().is_some();\r\n}\r\n```\r\n\r\nIs there currently a way to do this with the `ignore` crate I've missed? If not, are you willing to include such a feature? I'm available for discussion and implementation work :)\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/BurntSushi/ripgrep/issues/comments/258170293","html_url":"https://github.com/BurntSushi/ripgrep/issues/216#issuecomment-258170293","issue_url":"https://api.github.com/repos/BurntSushi/ripgrep/issues/216","id":258170293,"user":{"login":"BurntSushi","id":456674,"avatar_url":"https://avatars.githubusercontent.com/u/456674?v=3","gravatar_id":"","url":"https://api.github.com/users/BurntSushi","html_url":"https://github.com/BurntSushi","followers_url":"https://api.github.com/users/BurntSushi/followers","following_url":"https://api.github.com/users/BurntSushi/following{/other_user}","gists_url":"https://api.github.com/users/BurntSushi/gists{/gist_id}","starred_url":"https://api.github.com/users/BurntSushi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BurntSushi/subscriptions","organizations_url":"https://api.github.com/users/BurntSushi/orgs","repos_url":"https://api.github.com/users/BurntSushi/repos","events_url":"https://api.github.com/users/BurntSushi/events{/privacy}","received_events_url":"https://api.github.com/users/BurntSushi/received_events","type":"User","site_admin":false},"created_at":"2016-11-03T15:08:30Z","updated_at":"2016-11-03T15:08:30Z","body":"Oh, and yes, asking more questions here is encouraged. Please do!\r\n\r\nYou can also find me on most of the Rust IRC channels with the same `burntsushi` handle. However, I don't log on to IRC during work. Prime time for me tends to be 4-9PM EST and potentially large chunks of time on the weekend, but that can vary."}}
{"actor":{"display_login":"BurntSushi"}}