Skip to main content

A script to search for a file in a list of directories.

Project description

isort black pypi version downloads/monthly total downloads python versions license

pathsearch

A script to search for a file in a list of directories.

Install

You can install this script from PyPi with your favorite package manager. For example:

pip install pathsearch
poetry add pathsearch

Or you can install it from source:

# clone the repository
git clone https://github.com/mrlegohead0x45/pathsearch/
# or if you have github cli
gh repo clone mrlegohead0x45/pathsearch

cd pathsearch

# install the package
pip install -e .
# or you can just run it directly
python pathsearch.py

Usage

$ pathsearch -h
usage: pathsearch [-h] [-V] [-pe] [-v | -q] (-p PATH | -e VAR) file

Search for a file in a list of directories

positional arguments:
file                  File to search for on the specified path

options:
-h, --help            show this help message and exit
-V, --version         show program's version number and exit
-pe, --pathext        Look for file with extensions in environment variable PATHEXT (normally only set on Windows) (default: False)
-v, --verbose         Be verbose
-q, --quiet           Be quiet (only print found files)
-p PATH, --path PATH  Literal path to look in (e.g. /usr/bin:/bin:/usr/sbin:/sbin)
-e VAR, --env VAR     Environment variable to take path to search from (e.g. PATH or LD_LIBRARY_PATH)

Copyright (c) 2022 mrlegohead0x45. Licensed under the MIT License, which can be found in the source code of this program, or online at https://opensource.org/licenses/MIT. This program can be found online at
https://github.com/mrlegohead0x45/pathsearch and https://pypi.org/project/pathsearch/

You can specify a literal path to look in with the -p or --path option. Or, you can specify an environment variable to take the path from with the -e or --env option. The -pe or --pathext option is generally only useful on Windows, and will look for files with extensions in the PATHEXT environment variable, for example, pathsearch -pe -e PATH cmd will look for cmd.exe, cmd.bat, cmd.com etc. in the path. See https://superuser.com/questions/1027078/what-is-the-default-value-of-the-pathext-environment-variable-for-windows for more information.

License

This project is licensed under the MIT license, the text of which is available at https://opensource.org/licenses/MIT and in the LICENSE file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pathsearch-1.1.4.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pathsearch-1.1.4-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file pathsearch-1.1.4.tar.gz.

File metadata

  • Download URL: pathsearch-1.1.4.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Windows/10

File hashes

Hashes for pathsearch-1.1.4.tar.gz
Algorithm Hash digest
SHA256 b380bb47904f2b25bedb4bc723c988a3befec5f993e42dfc8b8099990b9b3059
MD5 28dd04c56ce88f2c19ff0d90b30c67b6
BLAKE2b-256 e8c72834b42b8a2cb0ba3fedf9d15e1611d86acf9cf4e8278360a9838833c74e

See more details on using hashes here.

File details

Details for the file pathsearch-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: pathsearch-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Windows/10

File hashes

Hashes for pathsearch-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7ae5f430db3484ee92155fac7983ab1503824da25951a8d3128db96e66eec624
MD5 e5bb909d7e83d74eabecf3223dfde8db
BLAKE2b-256 2deb9373290935716459de03b49e3510a5978e7f317e753de196ad4ada669ff2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page