PathMarker is a simple command line tool that solves the perpetual problem of selecting files out of bash output.
PathMarker is inspire by guake terminal, base on Facebook PathPicker.
It is easiest to understand by watching simple demos:
After installing PathMarker, using it is as easy as piping into PathMarker set.
It takes a wide variety of input -- try it with all the options below:
git status | PathMarker.py sethg status | PathMarker.py setgit grep "FooBar" | PathMarker.py setgrep -r "FooBar" . | PathMarker.py setgit diff HEAD~1 --stat | PathMarker.py setfind . -iname "*.js" | PathMarker.py setarc inlines | PathMarker.py set
and anything else you can dream up!
Files in the output will marked by number.
After use PathMarker.py set to mark files. You can use files with PathMarker.py get.
Numbers follow PathMarker.py get will replace by files name marked by PathMarker.py set.
Try:
PathMarker.py get vim 1PathMarker.py get md5sum 1 2 3
cd /usr/local/ # or wherever you install appsgit clone https://github.com/zqb-all/PathMarker.gitcd PathMarker/git submodule initgit submodule update
Here we make a symbolic link from the bash script in the repo
to /usr/local/bin/ which is assumed to be in the current
$PATH
ln -s "$(pwd)/PathMarker.py" /usr/local/bin/PathMarker.pynow PathMarker.py should workgit show | PathMarker.py setPathMarker.py get vim 1
For easily to use PathMarker.py with git/vim, try source PathMarker_help.sh in .bashrc
echo "source $(pwd)/PathMarker_help.sh" >> ~/.bashrcsource ~/.bashrc
Now you can use t as git, v as vim, fcd as cd, ffd as fd, ffind as find
t showv 1ffd srcffind . -name srcfcd 1
Note: If you don't have fd, ffd just same as ffind If you don't like these command, just modify PathMarker_help.sh
PathMarker is BSD-licensed.
