closest

command module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2025 License: MIT Imports: 7 Imported by: 0

README

closest - inverted find

closest finds files (or directories) in the current working directory and all parent directories.

Example:

% pwd
/home/alice/dev/experiments/utils/closest/a/b/c

# find the closest .git directory
% closest .git
/home/alice/dev/experiments/utils/closest/.git

# add -p to show the parent directory of found files or directories
% closest -p .git
/home/alice/dev/experiments/utils/closest

# -a shows all parent .git directories / files
% closest -a .git
/home/alice/dev/experiments/utils/closest/.git
/home/alice/dev/experiments/utils/.git
/home/alice/dev/.git

# missing targets throw an error to STDERR
% closest foo
"foo" not found
exit 1

Installation

closest is a simple go program and is currently only available as source code.

Use go's go install command to download and install closest in your $GOPATH/bin directory.

go install codeberg.org/japh/closest@latest

Usage

%closest [options] <filename>...
Options

-a show all matches -p only show the parent directory of any found files

Source

https://codeberg.org/japh/closest

Author

Stephen Riehm japh-codeberg@opensauce.de

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL