Skip to content

whereis: implement basic whereis utility#588

Open
tuxnode wants to merge 8 commits into
uutils:mainfrom
tuxnode:feat/whereis
Open

whereis: implement basic whereis utility#588
tuxnode wants to merge 8 commits into
uutils:mainfrom
tuxnode:feat/whereis

Conversation

@tuxnode

@tuxnode tuxnode commented Jul 9, 2026

Copy link
Copy Markdown

Summary

  • Add initial whereis utility that locates binary, source, and manual files for a command
  • Supports -b (binaries), -s (source), -m (man pages), and -a (all) options
  • Follows uutils/coreutils patterns with uumain and uu_app structure

Implementation

  • Search PATH for binary files
  • Search /usr/src and /usr/local/src for source files (.c, .cpp, .h, .rs, etc.)
  • Search standard man directories for manual pages

Tests

  • Basic functionality test
  • Non-existent program handling
  • Binary-only search mode

Closes #396

tuxnode added 7 commits July 9, 2026 21:06
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement whereis

1 participant