whereis: implement basic whereis utility#588
Open
tuxnode wants to merge 8 commits into
Open
Conversation
Add initial whereis utility that locates binary, source, and manual files for a command. Supports -b, -s, -m, and -a options.
Add whereis to root Cargo.toml dependencies and feat_common_core. Add test module registration in tests/tests.rs.
Add test cases for whereis utility including basic functionality, non-existent program handling, and binary-only search.
Fix test_whereis_binary_only to not hardcode Unix path /usr/bin/ls. The test now checks for 'ls:' prefix without requiring specific path.
- Search man directories recursively with proper path patterns - Support compressed man pages (.gz, .bz2, .xz, .zst, .Z) - Return first match only to match GNU whereis output format - Default behavior now searches binary + source + man (no flags)
Add tests for: - -m flag (man pages search) - Multiple programs search - Default behavior verification
- Fix cargo fmt formatting issues - Add cfg(unix) guards for Unix-specific test assertions - Remove duplicate test functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
whereisutility that locates binary, source, and manual files for a command-b(binaries),-s(source),-m(man pages), and-a(all) optionsuumainanduu_appstructureImplementation
PATHfor binary files/usr/srcand/usr/local/srcfor source files (.c,.cpp,.h,.rs, etc.)Tests
Closes #396