| Crates.io | scanit |
| lib.rs | scanit |
| version | 0.3.9 |
| created_at | 2024-12-20 20:00:48.16911+00 |
| updated_at | 2025-02-23 16:12:00.077239+00 |
| description | A fast, multi-threaded filesystem search tool |
| homepage | |
| repository | https://github.com/alexcu2718/scanit |
| max_upload_size | |
| id | 1490483 |
| size | 54,871 |
A command-line utility that recursively searches directories for files matching regex patterns.
Notably this is my first rust cli. It's probably redundant in favour of fd. It is faster in certain cases(if you don't want to search directories), and probably easier to use!
cargo install scanit
Increased efficiency of matching algorithm for colours. Added colours to display as an environment variable.
You can force colours by using 'export SCANIT_COLOUR=true' (add it to your shell environment)
Changed memory allocator choices for Linux, kept mimalloc for Windows Fixed minor bugs. Unnecessary conversions
Tested colours to test if they work on Windows, they will work on powershell, kitty etc, but not basic cmd.
Dramatically increased colour selection, sped up colour matching DRAMATICALLY(thanks memchr!). Fixed some slight inefficiency in the full path options. !!! NOTE I HAVE NOT TESTED THE COLOUR MATCHING ON WINDOWS, THIS IS ON THE LIST TO DO. SO COLOUR MATCHING IS NOT AVAILABLE, WILL BE IN NEXT RELEASE. The speed is on par or better than fd, with a lot better colours!
Changed the structure of the code to work on bytes. The convenience function 'find_files' now returns an OsString (because I prefer to leave this option to the caller)
Put the following into your respective shell config
eval "$(scanit --generate $SHELL_NAME)"
bash, elvish, fish, powershell, zshAdded -g flag for glob-style pattern matching
Searches entire path names
Examples:
scanit "**py3**.py" -g # Find Python files with 'py3' in path
Added an option to search full paths/file ends only NOTE: glob works on full paths by default.
I've added an option --colour option (also aliased to --color for yanks, basically it colours depending on file extension endings), I've not tested it too much, I still have a lot to work on. Such as implementing a file config option for it. Don't expect much, it carries a MINOR bit of overhead.
Simplified code base a bit, added thiserror for better error handling(it shouldn't return errors for missed file paths due to permissions errors, because this will happen a lot!)
Added path checking to check if valid path.
Started to use arcstr crate due to avoiding less memory allocations.
Added a different memory allocator for Linux, this should speed up processing.
It is a lot faster, also rewrote the printing function I used.
Added configuration options:
Better error handling yet again(I will probably use thiserror/anyhow in my next iteration)
scanit '.py' / -r (This was added as an easier way to search for certain extensions etc.)
scanit llvm /usr -t 10
scanit '.rs$' /usr
scanit . -a -i -s # . = pattern, -a = --show-hidden, -i = --include-dirs, -s = --sys-paths
scanit '.png$' -c # -c = --current-directory
scanit '^/.test..js$'
scanit -a '.git'
scanit zshrc -a -i # -i = --include-directories
scanit PYTHON -e # -e = --case-insensitive (e is short for everything and I didn't want to change my current directory argument!)
Usage: scanit [OPTIONS] [PATTERN] [DIRECTORY] Note: Options can go before or after arguments.
| Argument | Description |
|---|---|
| PATTERN | Regex pattern to match against filenames |
| DIRECTORY | Path to search (defaults to / on Unix systems or C:/ on Windows) |
| Option | Description | Default |
|---|---|---|
-c, --current-directory |
Uses the current directory to load | - |
-a, --show-hidden |
Shows hidden files (e.g. .gitignore, .bashrc) | - |
-e, --case-insensitive |
Enable case-insensitive matching | - |
-n, --num-threads <THREAD_NUM> |
Number of threads to use | Available CPU threads |
-i, --include-dirs |
Include directories in search results | - |
-s, --sys-paths |
Include system paths (/proc, /sys, /tmp, /run, /dev, /sbin) | - |
-d, --depth <MAX_DEPTH> |
Maximum search depth in directories | - |
-t, --top <TOP_N> |
Retrieve first N results (no sorting supported) | - |
-r, --regex-escape |
Perform literal search (conflicts with --glob) |
- |
--generate |
Generate completions [bash, elvish, fish, powershell, zsh] | - |
-g, --glob |
Use glob pattern matching (conflicts with --regex-escape and --full-path) |
- |
--colour |
Colour output depending on file extension, it's not extensive yet. WIP | - |
-f, --full-path |
Match regex against full path (conflicts with --glob) |
- |
-h, --help |
Print help information | - |
-V, --version |
Show version number | - |