Thanks to visit codestin.com
Credit goes to github.com

Skip to content

mattmc3/pather

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pather

Path manipulation tool inspired by Zsh parameter expansion modifiers.

Instead of chaining dirname, basename, and realpath, you can do:

pather -ahh /path/to/file.txt     # grandparent directory
pather -at ../relative/path       # absolute basename
pather -r file.tar.gz             # strip extension

Install

macOS:

brew tap mattmc3/tools
brew install pather

On other systems clone this repository and put the pather Lua script in your path.

Usage

pather [-aAther] path [...]

Modifiers work like Zsh's ${var:a:h:t} syntax:

  • -a absolute path
  • -A absolute + resolve symlinks
  • -t tail (basename)
  • -h head (dirname)
  • -e extension only
  • -r remove extension

License

MIT

About

A simple CLI utility for path parsing

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages