Git Product home page Git Product logo

sf's Introduction

๐Ÿ”Ž๐Ÿ“„ sf

Simple Find

simple file search

  • colourful output and search indicating spinner by default
    • disable via --performance flag
  • filter by file, directory and file-extension
  • exclude patterns from the search
    • via --exclude flag
  • exclude hidden files
    • via --no-hidden flag
  • show number of searched entries, search results and search time
    • via --stats flag
  • only show number of search results
    • via --count flag
  • search case-insensitivly
    • via --case-insensitive flag
  • set maximum search depth
    • via --depth flag
  • accepts . as current directory
  • no regex search (for now)

Example

  • search for every file and directory that contains the word 'ron', excluding hidden files but including *.ron files

sf ron . -s

screenshot

screenshot

  • search all python files in a specified directory but only show stats at the end

sf "" ~\main\ -e py -sc

screenshot

  • search only files containing the word helix, exclude results containing the words test or json or bin

sf helix . -fs -E test json bin

screenshot

  • count all entries in the current directory and disable the search indicating spinner

sf "" . -cp

screenshot

  • you can use sf to list all files and sub-directories recursively via "" as an empty search pattern

sf "" .

Usage

Short Usage

sf [OPTIONS] [PATTERN] [PATH] [COMMAND]

Commands:
  log, -L, --log  Show content of the log file
  help            Print this message or the help of the given subcommand(s)

Arguments:
  [PATTERN] [PATH]  Add a search pattern and a path

Options:
  -i, --case-insensitive           Search case insensitivly
  -c, --count                      Only print the number of search results
  -D, --depth <NUMBER>             Set max search depth [default: 250]
  -d, --dir                        Search only in directory names for the pattern
  -e, --extension <EXTENSIONS>...  Only search in files with the given extensions
  -E, --exclude <PATTERNS>...      Enter patterns to exclude from the search
  -f, --file                       Search only in file names for the pattern
  -H, --no-hidden                  Exclude hidden files and directories from search
  -o, --override                   Override all previously set flags
  -p, --performance                Disable spinner, don`t colourize the search output and speed up the output printing
  -s, --stats                      Show search statistics at the end
  -h, --help                       Print help (see more with '--help')
  -V, --version                    Print version

Long Usage

sf [OPTIONS] [PATTERN] [PATH] [COMMAND]

Commands:
  log, -L, --log
          Show content of the log file
  help
          Print this message or the help of the given subcommand(s)

Arguments:
  [PATTERN] [PATH]
          Add a search pattern and a path

Options:
  -i, --case-insensitive
          Search case insensitivly

  -c, --count
          Only print the number of search results
          Can be combined with the --stats flag to only show stats and no other output

  -D, --depth <NUMBER>
          Set max search depth

          [default: 250]

  -d, --dir
          Search only in directory names for the pattern

  -e, --extension <EXTENSIONS>...
          Only search in files with the given extensions
          Must be provided after the pattern and the search path

  -E, --exclude <PATTERNS>...
          Enter patterns to exclude from the search
          Must be provided after the pattern and the search path

  -f, --file
          Search only in file names for the pattern

  -H, --no-hidden
          Exclude hidden files and directories from search
          If a directory is hidden all its content will be skiped as well

  -o, --override
          Override all previously set flags
          This can be used when a custom alias for this command is set together with regularly used flags
          This flag allows to disable these flags and specify new ones

  -p, --performance
          Focus on performance
          Disable search indicating spinner and don`t colourize the search output
          Write the output via BufWriter

  -s, --stats
          Show search statistics at the end
          Can be combined with the --count flag to only show stats and no other output

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

Installation

Windows

via Cargo or get the binary

Known Issues

PowerShell

  • sf "" . -e rs to find all Rust files in the current directory doesn`t work in PowerShell solution => you have to escape the quotes:

sf `"`" . -e rs

sf's People

Contributors

phydon avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.