Skip to content

massivebird/bsrc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bsrc

short for "bespoke search"

A customizable file search utility!

🦀 written in Rust

Elevator pitch

Native OS file searching is slow, unordered, and difficult to customize. bsrc solves all of that.

bsrc searches for file/directory names using a regex pattern, only in paths defined in a TOML config file (see: Configuration). This results in fast, inexpensive, and uncluttered searches!

bsrc's suite of command line options also let you customize search and output behavior on the fly.

bsrc is especially great for large archives or libraries of games, music, or books!

Building

To manually build the project, you must first install Rust.

Once you have Rust installed, run the following commands:

$ git clone https://github.com/massivebird/bsrc
$ cd bsrc

$ cargo run           # unoptimized build
# OR
$ cargo run --release # optimized build

Adding bsrc to your PATH

If you want to add bsrc to your PATH, I recommend building it in release mode for better optimization.

$ cd bsrc
$ cargo build --release
$ ln -rs ./target/release/bsrc <dir-in-PATH>/bsrc
$ bsrc

Usage

Basic bsrc syntax is as follows:

bsrc <query>

For more information, run bsrc --help.

Configuration

bsrc is configured with bsrc.toml.

Here is an example configuration:

# ./archive/bsrc.toml

# Optional: remove pattern from match names.
# e.g. '\(.*\)' produces "Metal (USA, EUR)" -> "Metal"
clean = '\(.*\)' 
                 
# Optional: ignore files based on a regex pattern.
# e.g. '^\.' prevents matching files like `.bios`
ignore = '^\.'

# Optional: custom output format.
# `%p`: prefix
# `%f`: matching filename
output_fmt = '%p :: %f'

[dirs.snes] # dirs.<unique-id>
prefix = "SNES"
path = "snes"
color = "#5930cc"  # Optional: prefix color in hex format
match_dirs = false # Optional: if true, matches directories instead of files

[dirs.wii]
prefix = "WII"
path = "wbfs"
color = "#0cab30"
match_dirs = false

About

A bespoke, customizable file searching utility

Resources

License

Stars

Watchers

Forks

Packages

No packages published