Skip to content

Latest commit

 

History

History
101 lines (63 loc) · 2.25 KB

README.md

File metadata and controls

101 lines (63 loc) · 2.25 KB

Pather

Pather is a command-line utility written in Rust for managing the PATH environment variable. It allows you to easily add or remove directories from your PATH, with support for common shell configuration files such as .bashrc, .zshrc, and config.fish.

Features

  • Add a directory to the beginning of the PATH variable.
  • Remove a directory from the PATH variable.
  • Automatically update your shell configuration file.
  • Supports bash, zsh, and fish shells.
  • Command-line interface with options for displaying help and version information.

Installation

To build and run Pather, you'll need to have Rust installed on your machine. You can install Rust using rustup.

Clone the repository and build the project:

git clone https://github.com/ptreew/pather.git
cd pather
cargo build --release

You can then run the binary:

./target/release/pather

Usage

Pather can be used to add or remove directories from your PATH variable. If no arguments are provided, it will toggle the presence of the current directory in PATH.

Add a Directory to PATH:

pather /path/to/directory

This will add /path/to/directory to the beginning of your PATH variable.

Remove a Directory from PATH:

pather /path/to/directory

This will remove /path/to/directory from your PATH variable if it exists.

Toggle Current Directory in PATH:

pather

Running Pather with no arguments will add the current directory to PATH if it is not already present, or remove it if it is.

Display Help:

pather --help # -h can be used

Display Version:

pather --version # -v can be used

Example:

# Add /usr/local/bin to PATH
pather /usr/local/bin

# Remove /usr/local/bin from PATH
pather /usr/local/bin

# Add or remove the current directory from PATH
pather

# Display help message
pather --help

# Display version
pather --version

Contributing

Contributions are welcome! If you find a bug or have a feature request, please open an issue on GitHub. Feel free to fork the repository.

License

This project is licensed under the MIT License - see the LICENSE file for details.