85 lines
1.5 KiB
Markdown
85 lines
1.5 KiB
Markdown
# manwhere
|
|
|
|
A fast, simple command-line tool to search man pages by keyword, written in Zig.
|
|
|
|
## Usage
|
|
|
|
### Basic Search
|
|
|
|
```bash
|
|
manwhere sleep # Find all man pages mentioning "sleep"
|
|
# Output:
|
|
# sleep
|
|
# appsleepd
|
|
```
|
|
|
|
### Interactive Selection with fzf
|
|
|
|
```bash
|
|
manwhere sleep | fzf | xargs man # Select and open a man page
|
|
```
|
|
|
|
### Section Filtering
|
|
|
|
```bash
|
|
manwhere -s 1 sleep # Find only commands (section 1)
|
|
manwhere --section 3 sleep # Find only library functions (section 3)
|
|
manwhere -s 1 -s 3 sleep # Search sections 1 and 3
|
|
```
|
|
|
|
### Help
|
|
|
|
```bash
|
|
manwhere -h # Show help message
|
|
```
|
|
|
|
## Building
|
|
|
|
### Prerequisites
|
|
|
|
- Zig 0.15.1 or later
|
|
|
|
### Build Commands
|
|
|
|
```bash
|
|
# Debug build (for development)
|
|
zig build
|
|
|
|
# Release build (installs to ~/.local/bin)
|
|
zig build release
|
|
```
|
|
|
|
## Example Workflows
|
|
|
|
### Find and open a man page
|
|
|
|
```bash
|
|
manwhere printf | fzf | xargs man
|
|
```
|
|
|
|
### Quick lookup with preview
|
|
|
|
```bash
|
|
manwhere sleep | fzf --preview 'man {}'
|
|
```
|
|
|
|
### Scripting
|
|
|
|
```bash
|
|
# Find all SSL-related functions
|
|
manwhere ssl | while read name; do
|
|
man 3 "$name" 2>/dev/null && break
|
|
done
|
|
```
|
|
|
|
## POSIX Compatibility
|
|
|
|
Works reliably on:
|
|
|
|
- **Linux**: Standard `/usr/share/man` and `/usr/local/share/man`
|
|
- **macOS**: Standard paths plus Homebrew (`/opt/homebrew/share/man`) and MacPorts (`/opt/local/share/man`)
|
|
- **Other Unix-like systems**: Standard man page directory structures
|
|
|
|
## License
|
|
|
|
This project is open source. See the source code for license details.
|