Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/edi9999/path-extractor
A unix filter which outputs the filepaths found in stdin
https://github.com/edi9999/path-extractor
Last synced: 11 days ago
JSON representation
A unix filter which outputs the filepaths found in stdin
- Host: GitHub
- URL: https://github.com/edi9999/path-extractor
- Owner: edi9999
- License: mit
- Created: 2015-06-21T13:34:26.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-09-09T16:11:13.000Z (about 2 years ago)
- Last Synced: 2024-05-22T18:32:34.832Z (6 months ago)
- Language: Go
- Homepage:
- Size: 28.3 KB
- Stars: 170
- Watchers: 5
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# PathExtractor (pe)
![demo](https://raw.github.com/edi9999/i/master/demo.gif?v=2)
PathExtractor is a command line tool that extracts a list of files/paths from stdin.
Advantages over [fpp](https://github.com/facebook/PathPicker):
- It does only one thing : more unixy
- You can use it with any fuzzy finder, such as [fzf](https://github.com/junegunn/fzf),[peco](https://github.com/peco/peco),[percol](https://github.com/mooz/percol),[pick](https://github.com/thoughtbot/pick),[selecta](https://github.com/garybernhardt/selecta/)
- It doesn't wait for stdin to be finished to output the paths
- It is faster
- It is much smaller (easily understandable)
- You can also use it without a fuzzy finder for programmatic usageFor example, you could write:
```sh
git status | pe
```to get a list of the files that were added/changed, without all the formating
One of the most common usage is to create an alias that will automatically run :
`pe` + a command line fuzzy finder such as fzf + an action such as opening that file in your favorite editor.
For example, using `zsh` , I have as an alias:
```sh
alias -g P='| pe | fzf | read filename; [ ! -z $filename ] && vim $filename'
```With `bash`:
```sh
bind '"PP": "| pe | uniq | fzf | while read filename; do [ ! -z $filename ] &&