Giter Site home page Giter Site logo

facebook / pathpicker Goto Github PK

View Code? Open in Web Editor NEW
5.1K 122.0 281.0 1.42 MB

PathPicker accepts a wide range of input -- output from git commands, grep results, searches -- pretty much anything. After parsing the input, PathPicker presents you with a nice UI to select which files you're interested in. After that you can open them in your favorite editor or execute arbitrary commands.

Home Page: https://facebook.github.io/PathPicker/

License: MIT License

CSS 3.66% HTML 6.05% Python 86.24% Shell 3.49% Ruby 0.56%

pathpicker's Introduction

PathPicker

tests License: MIT

Facebook PathPicker is a simple command line tool that solves the perpetual problem of selecting files out of bash output. PathPicker will:

  • Parse all incoming lines for entries that look like files
  • Present the piped input in a convenient selector UI
  • Allow you to either:
    • Edit the selected files in your favorite $EDITOR
    • Execute an arbitrary command with them

It is easiest to understand by watching a simple demo:

Examples

After installing PathPicker, using it is as easy as piping into fpp. It takes a wide variety of input -- try it with all the options below:

  • git status | fpp
  • hg status | fpp
  • git grep "FooBar" | fpp
  • grep -r "FooBar" . | fpp
  • git diff HEAD~1 --stat | fpp
  • find . -iname "*.js" | fpp
  • arc inlines | fpp

and anything else you can dream up!

Requirements

PathPicker requires Python 3.

Supported Shells

  • Bash is fully supported and works the best.
  • ZSH is supported as well, but won't have a few features like alias expansion in command line mode.
  • csh/fish/rc are supported in the latest version, but might have quirks or issues in older versions of PathPicker. Note: if your default shell and current shell is not in the same family (bash/zsh... v.s. fish/rc), you need to manually export environment variable $SHELL to your current shell.

Installing PathPicker

Homebrew

Installing PathPicker is easiest with Homebrew for mac:

  • brew update (to pull down the recipe since it is new)
  • brew install fpp

Linux

On Debian-based systems, run these steps: fakeroot:

$ git clone https://github.com/facebook/PathPicker.git
$ cd PathPicker/debian
$ ./package.sh
$ ls ../pathpicker_*_all.deb

On Arch Linux, PathPicker can be installed from Arch User Repository (AUR). (The AUR fpp-git package.)

If you are on another system, or prefer manual installation, please follow the instructions given below.

Manual Installation

If you are on a system without Homebrew, it's still quite easy to install PathPicker, since it's essentially just a bash script that calls some Python. These steps more-or-less outline the process:

  • cd /usr/local/ # or wherever you install apps
  • git clone https://github.com/facebook/PathPicker.git
  • cd PathPicker/

Here we create 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)/fpp" /usr/local/bin/fpp
  • fpp --help # should work!

Add-ons

For tmux users, you can additionally install tmux-fpp which adds a key combination to run PathPicker on the last received stdout. This makes jumping into file selection mode even easier. (Check it out here!)

Advanced Functionality

As mentioned above, PathPicker allows you to also execute arbitrary commands using the specified files. Here is an example showing a git checkout command executed against the selected files:

The selected files are appended to the command prefix to form the final command. If you need the files in the middle of your command, you can use the $F token instead, like:

cat $F | wc -l

Another important note is that PathPicker, by default, only selects files that exist on the filesystem. If you want to skip this (perhaps to selected deleted files in git status), just run PathPicker with the --no-file-checks (or -nfc, for short) flag.

How PathPicker works

PathPicker is a combination of a bash script and some small Python modules. It essentially has three steps:

  • Firstly, the bash script redirects all standards out into a python module that parses and extracts out filename candidates. These candidates are extracted with a series of regular expressions, since the input to PathPicker can be any stdout from another program. Rather than make specialized parsers for each program, we treat everything as noisy input, and select candidates via regexes. To limit the number of calls to the filesystem (to check existence), we are fairly restrictive on the candidates we extract.

The downside to this is that files that are single words, with no extension (like test), that are not prepended by a directory will fail to match. This is a known limitation to PathPicker, and means that it will sometimes fail to find valid files in the input.

  • Next, a selector UI built with curses is presented to the user. At this point you can select a few files to edit, or input a command to execute.

  • Lastly, the python script outputs a command to a bash file that is later executed by the original bash script.

It's not the most elegant architecture in the world but, in our opinion, it provides a lot of utility.

Documentation & Configuration

For all documentation and configuration options, see the output of fpp --help.

Join the PathPicker community

See the CONTRIBUTING.md file for how to help out.

License

PathPicker is MIT licensed.

pathpicker's People

Contributors

64kramsystem avatar code-reaper08 avatar david-caro avatar dduong42 avatar deelam avatar dmitryvinn avatar dragonxlwang avatar engz avatar frantic avatar groomsy avatar gsheld avatar hlian avatar ismith avatar jonathanaquino avatar kapji avatar lastquestion avatar metavida avatar ngavalas avatar pallavagarwal07 avatar pcottle avatar prubel avatar rjdean123 avatar robertbachmann avatar sethwoodworth avatar ssgelm avatar thiagowfx avatar timgates42 avatar timspence avatar wasade avatar weakish avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pathpicker's Issues

Allow use of shell aliases

I have a ton of git aliases and would like to use them with command mode. Otherwise the mode is practically worthless.

fbPager.sh: line 4: gco: command not found

Allow selection of items interactively with search keywords

The basic idea is great... But manually picking a bunch of items is ok, but you should also be able to interactively search for items to add to the selection list. Why? Because sometimes, you have alot of matching files, and manually picking them is tedious. Regex's are ok, but only basic regexs are what 99% of people understand. Think as simple as . or *.jpg, or *.js, and you've reached 90% of the understanding of the regex crowd.

For example, say I was in interactive mode, and had selected a few files by hitting f on each file.

I should also be able to enter "search mode" by typing / and then specifying a search query like the following:

test ez ab super$ ^black

which would match any file that has:

  • the words test, ez, ab in their filename
  • begins with the world black
  • ends with the word super
  • the results of this search would be shown in a filtered search result, and users could select matching items in this sub search by using the f shortcut.

If you did this.... this tool would be extra awesome!

fpp fails when called from a symlink in Linux

I'm creating an Arch package for PathPicker right now but I can't make a symlink to fpp work. This is the error I get:

/home/lsmag/my-symlink-fpp: line 18: cd: /home/lsmag//home/lsmag/PathPicker: No such file or directory
python2: can't open file '/src/processInput.py': [Errno 2] No such file or directory
python2: can't open file '/src/choose.py': [Errno 2] No such file or directory
:D

As you can see, the problem is /home/lsmag//home/lsmag/PathPicker = /home/lsmag/ + /home/lsmag/PathPicker, which is the predictable output of both dirname and readlink.

Using readlink -f, however, the command runs just fine. This is how it is on my machine now:

while [ -h "$WHEREAMI" ]; do
  WHEREAMI=$(readlink -f "$WHEREAMI")
done

I don't know if it still works on Macs, though.

Doesn't handle paths with spaces in them

Both the highlighting and file-opening are tripped up by paths with spaces in them.

I tested with the output of OS X's mdfind -name foo (one path per line) piped into fpp.

Incorrect matching on files with multiple dots

If you have a file like "Company.Project.sln" or "archive.tar.gz", the highlighting and file name matching are incorrect. For example, fpp highlight and try to execute a command on "Project.sln" or "tar.gz".

I have a directory that breaks fpp

$ ls Music|fpp
Traceback (most recent call last):
File "/home/jackson/src/PathPicker/src/choose.py", line 55, in <module>
curses.wrapper(doProgram)
File "/usr/local/lib/python2.7/curses/wrapper.py", line 43, in wrapper
return func(stdscr, *args, **kwds)
File "/home/jackson/src/PathPicker/src/choose.py", line 26, in doProgram
screen.control()
File "/home/jackson/src/PathPicker/src/screenControl.py", line 266, in control
self.moveCursor()
File "/home/jackson/src/PathPicker/src/screenControl.py", line 498, in moveCursor
self.stdscr.move(y, x)
_curses.error: wmove() returned ERR

I put a pastebin of 'ls Music' here:
http://pastebin.ca/raw/2999325

I can't figure out what it's puking on though, I made another directory with some of the odd characters used and fpp handles that one fine...

Fails when relative path is not prepended with "./"

Doesn't play well with ack (or any other tool with similar output) because ack does not prepend a "./" to the file list returned from . E.g.

ack -l 'foo'
junk/foo/bar.txt

ack -l 'foo' | fpp <------- Does not work needs ./junk/foo/bar.txt instead.

Ctrl + C quits with exception

Traceback (most recent call last):
  File "/usr/local/Cellar/fpp/0.5.3/libexec/src/choose.py", line 58, in <module>
    curses.wrapper(doProgram)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/local/Cellar/fpp/0.5.3/libexec/src/choose.py", line 30, in doProgram
    screen.control()
  File "/usr/local/Cellar/fpp/0.5.3/libexec/src/screenControl.py", line 262, in control
    inKey = self.getKey()
  File "/usr/local/Cellar/fpp/0.5.3/libexec/src/screenControl.py", line 490, in getKey
    charCode = self.stdscr.getch()
KeyboardInterrupt

How to make fpp only output the file list, so that you can plug in any file picker

Hi,

I already use https://github.com/junegunn/fzf as my general fuzzyfinder, and would really enjoy using the calculated filenames of fpp to feed into fzf. Is it possible to only output the list of files, instead of giving always a UI ?
It would also make more sense because a unix tool should try to do one thing well. I think with this in mind, it would even make sense to have two utilities that could together work as a path picker : the first one which does only the conversion from an output to a list of filenames, the second one which gives an UI to select one or more elements from a list.

Hope that you agree with that.

breaks when the file path contains duplicate dir names

git diff --stat
tweets/server/src/main/scala/com/twitter/tweets/Tweets.scala | 17 +++++++++++++---

git diff --stat | fpp
.../tweets/Tweets.scala | 17 ++++-

when you navigate to the item in fpp it attempts to open .../tweets/Tweets.scala which doesn't exist. The full path that's printed out when not using fpp is the correct path.

Curses error

https://www.technovelty.org/linux/a-short-tour-of-term.html
My terminal is set to xterm-color and I am getting following error

Traceback (most recent call last):
File "/usr/local/Cellar/fpp/0.5.5/libexec/src/choose.py", line 56, in
curses.wrapper(doProgram)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/curses/wrapper.py", line 43, in wrapper
return func(stdscr, _args, *_kwds)
File "/usr/local/Cellar/fpp/0.5.5/libexec/src/choose.py", line 27, in doProgram
screen.control()
File "/usr/local/Cellar/fpp/0.5.5/libexec/src/screenControl.py", line 275, in control
self.printAll()
File "/usr/local/Cellar/fpp/0.5.5/libexec/src/screenControl.py", line 493, in printAll
self.printChrome()
File "/usr/local/Cellar/fpp/0.5.5/libexec/src/screenControl.py", line 503, in printChrome
self.helperChrome.output(self.mode)
File "/usr/local/Cellar/fpp/0.5.5/libexec/src/screenControl.py", line 63, in output
curses.curs_set(INVISIBLE_CURSOR)
_curses.error: curs_set() returned ERR

choose.py Traceback when running fpp

Hi all,

I'm assuming this is either something I did or just an environment error but I'm not able to get the tool working on one of my notebooks. Here is what I'm seeing:

☁  jkup.github.io [master] ⚡ brew install fpp
==> Downloading https://homebrew.bintray.com/bottles/fpp-0.5.5.yosemite.bottle.tar.gz
Already downloaded: /Library/Caches/Homebrew/fpp-0.5.5.yosemite.bottle.tar.gz
==> Pouring fpp-0.5.5.yosemite.bottle.tar.gz
🍺  /usr/local/Cellar/fpp/0.5.5: 11 files, 80K
☁  jkup.github.io [master] ⚡ fpp
Using old result...
Traceback (most recent call last):
  File "/usr/local/Cellar/fpp/0.5.5/libexec/src/choose.py", line 56, in <module>
    curses.wrapper(doProgram)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/local/Cellar/fpp/0.5.5/libexec/src/choose.py", line 27, in doProgram
    screen.control()
  File "/usr/local/Cellar/fpp/0.5.5/libexec/src/screenControl.py", line 275, in control
    self.printAll()
  File "/usr/local/Cellar/fpp/0.5.5/libexec/src/screenControl.py", line 493, in printAll
    self.printChrome()
  File "/usr/local/Cellar/fpp/0.5.5/libexec/src/screenControl.py", line 503, in printChrome
    self.helperChrome.output(self.mode)
  File "/usr/local/Cellar/fpp/0.5.5/libexec/src/screenControl.py", line 63, in output
    curses.curs_set(INVISIBLE_CURSOR)
_curses.error: curs_set() returned ERR

My current version of python is 2.7.9

☁  jkup.github.io [master] ⚡ python --version
Python 2.7.9

I tried it in both zsh and bash but getting the same errors. Not sure if there is any other helpful info I can include. Would love it if you all had any suggestions!

BashRC

It'd be nice to load up your .bachrc and .bash_profile in command mode so you can use your aliases etc.

fpp doesn't pass path to command properly for paths in the top dir w/out ./ prefix

The output of ack -l or grep -l that lists as demonstrated below is parsed properly by fpp (the interactive selection works), but when you execute a command on it (for example open the editor) it doesn't pass the proper path.

In the case of the first file listed below, fpp passes the following to vim:

/home/user/www/system-images/android-22/default/x86_64

when the proper path is:

/home/user/**vendor/android/sdk/**system-images/android-22/default/x86_64/source.properties

  1. The CWD is /home/user/vendor/android/sdk/
  2. I have no idea where the www/ is coming from
ack xml -l | head                                                                                                                                                                    130 ↵
system-images/android-22/default/x86_64/source.properties
system-images/android-22/default/x86_64/NOTICE.txt
system-images/android-22/google_apis/x86_64/source.properties
system-images/android-22/google_apis/x86_64/NOTICE.txt
system-images/android-21/default/x86_64/source.properties
system-images/android-21/default/x86_64/NOTICE.txt
system-images/android-21/google_apis/x86/source.properties
system-images/android-21/google_apis/x86/NOTICE.txt
system-images/android-21/google_apis/x86_64/source.properties
system-images/android-21/google_apis/x86_64/NOTICE.txt

Offer a pure Python alternative script

I don't know if you are ok with replacing the shell script with a pure Python script, but even if you prefer to have the shell part, at least provide a pure Python version as an alternative.

This way you can us the tool under windows, and for any shell flavor (bash, sh, zsh, shell fish, etc).

In the end, i feel like it would be easier to get rid of the bash part completely though, since you can make a Python code working on any Python version, you can make it easily install a command (even if you don't have homebrew) and it's way simpler to unit test.

navigate by text line, not matched line

I'd like to be able to navigate up and down by line, and not automatically jump to the next line match. I'd imagine we could add a mode to flip the navigation keys into, or maybe alternately add new keys.

I'd prefer the former. I'd also like it to be a --command-line-switch so it can be passed in all the time.

I'll submit a PR for this sometime soon, as it would make path picker easier to use for me. Unless someone objects strongly, I'll implement a text-mode versus a match-mode, and have a key to flip between the two, and a command line option. And update the docs. and add it to the menu. Whew.

False positive on `and/or`

As part of its output, git status prints this:

use "git add" and/or "git commit -a"

PathPicker picks up and/or as a path. I don't know if excluding and/or specifically is a good idea, but given the popularity of git, I think that use "git add" and/or "git commit -a" could be specifically excluded.

Bad brew instructions

This:

brew upgrade; brew install fpp; fpp

Should probably be this:

brew update; brew install fpp; fpp

Unicode Handling

Unicode character is not displayed correctly, and unicode filename cannot be recognized, either.

To reproduce:

git init .
mkdir test
touch test/test
touch test/简体中文
git add test
git config core.quotepath false

Case 1

Expected output of LANG=C git status | fpp:

On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

    new file:   test/test
    new file:   test/简体中文

Actural output:

On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

    new file:   test/test
    new file:   test/��~@��~S中�~V~G

The 2nd "new file" cannot be selected.

Case 2

Actural output of LANG=zh_CN.UTF-8 git status | fpp


�~H~]��~K�~O~P交

��~A�~O~P交�~Z~D�~O~X�~[���~Z
  ��~H使�~T� "git rm --cached <file>..." �~R��~G��~Z~B��~X�~L���~I

V��VG件: test/test
V��VG件: test/��~@��S中�V~G


Breaks when not in toplevel Git directory

git status | fpp, selecting files, and applying them to git add works fine when I'm at the top level of a Git repo, but not if I enter a subdirectory. It appears to append the selected file to the git repo path, not pwd.

Linux packages

It would be good to have Linux packages available, at least .deb and .rpm versions. I don't know anyone that uses Linuxbrew, it doesn't seem ideal on Linux when better solutions exist.

The HHVM team distribute Linux packages, you could probably see how they do it.

line selection mode

Detecting paths is cool and everything, but I think it would be even more useful if there was a mode that treats every full input line as a "filename" (or other single parameter) and passes all selected lines to the output command, either one-by-one, or space-separated on the command line.

If this sounds useful to anyone else, I'll try to implement it and submit a pull request. It definitely seems to me like an entirely useful mode of operation.

By the way, thanks for fpp, it's a really awesome tool.

Python 3.0 compatibility

I'm on 10.10.3. Ran brew install fpp and then fpp, and got this:

File "/usr/local/Cellar/fpp/0.5.3/libexec/src/processInput.py", line 126
    print USAGE_STR
                  ^
SyntaxError: Missing parentheses in call to 'print'
  File "/usr/local/Cellar/fpp/0.5.3/libexec/src/choose.py", line 54
    print 'Nothing to do!'
                         ^
SyntaxError: Missing parentheses in call to 'print'
sh: /Users/dan/.fbPager.sh: No such file or directory

Arbitrary command mode doesn't have aliases or shell functions

When executing a command in arbitrary command mode, fpp is unaware of any aliases or shell functions I may have defined in my .zshrc (I'm using zsh but I've tested this in bash as well).

For example I have an alias gco="git checkout"and running gco in the arbitrary command mode gives:

.fbPager.sh: line 4: gco: command not found

dotfiles are ignored

for instance if I have
.gitignore
in my git status output. it can't be selected using PathPicker.

Testing multiple version of python.

There's an excellent tox package that can test multiple version of python in one command.
The only requirement is for the user to have the version installed.

Say you have all of this:

python26 -V
python27 -V
python33 -V
python34 -V

You can run one command to automatically test all of it:

tox

I already have it running in my local branch, let me know if you think this is good and I'll create a PR.

Doesn't detect files without extensions

You can reproduce this issue by putting a Makefile or Dockerfile in a directory and ls | fpp. It will work with other files in the directory that have an extension.

Canceling (Control-c) a command produces noisy output

If I'm not mistaken, canceling CTRL+c should produce no output like most/all other commands.

Currently, this is what happens (on Ubuntu bash 4.2 at least, untested elsewhere) :

$ grep -ir 'foo' . | fpp
^CTraceback (most recent call last):
  File "/usr/local/PathPicker/src/processInput.py", line 144, in <module>
    doProgram()
  File "/usr/local/PathPicker/src/processInput.py", line 120, in doProgram
    lineObjs = getLineObjs()
  File "/usr/local/PathPicker/src/processInput.py", line 102, in getLineObjs
    inputLines = sys.stdin.readlines()
KeyboardInterrupt
Nothing to do!
:D

Having problem running on Linux (Ubuntu 12.04 Precise)

I checked out the repo to: /usr/local/src/PathPicker and created the symlink like this:
root@precisebox:/usr/local/bin# ln -s /usr/local/src/PathPicker/fpp fpp

then when i try running fpp, i see this message:

hmuser@precisebox:~$ which fpp
/usr/local/bin/fpp
hmuser@precisebox:~$ fpp --help
/usr/local/bin/fpp: line 18: cd: /usr/local/bin//usr/local/src/PathPicker: No such file or directory
python2: can't open file '/src/printHelp.py': [Errno 2] No such file or directory

more info:

hmuser@precisebox:~$ readlink /usr/local/bin/fpp
/usr/local/src/PathPicker/fpp
hmuser@precisebox:~$ ls -al /usr/local/bin/fpp
lrwxrwxrwx 1 root root 29 May  7 16:45 /usr/local/bin/fpp -> /usr/local/src/PathPicker/fpp
hmuser@precisebox:~$ ls -al /usr/local/src/PathPicker/
total 60
drwxrwxr-x 5 hmuser hmuser 4096 May  7 16:37 .
drwxr-xr-x 3 root   root   4096 May  7 16:25 ..
drwxrwxr-x 2 hmuser hmuser 4096 May  7 16:24 assets
-rw-rw-r-- 1 hmuser hmuser 1918 May  7 16:24 CONTRIBUTING.md
-rwxrwxr-x 1 hmuser hmuser 1454 May  7 16:24 fpp
-rw-rw-r-- 1 hmuser hmuser  561 May  7 16:24 fpp.rb
drwxrwxr-x 8 hmuser hmuser 4096 May  7 16:24 .git
-rw-rw-r-- 1 hmuser hmuser   89 May  7 16:24 .gitignore
-rw-rw-r-- 1 hmuser hmuser 4502 May  7 16:24 index.html
-rw-rw-r-- 1 hmuser hmuser 1531 May  7 16:24 LICENSE
-rwxrwxr-x 1 hmuser hmuser  347 May  7 16:24 makeDist.sh
-rw-rw-r-- 1 hmuser hmuser 1981 May  7 16:24 PATENTS
-rw-rw-r-- 1 hmuser hmuser 3332 May  7 16:24 README.md
drwxrwxr-x 2 hmuser hmuser 4096 May  7 16:42 src

good thing is, the issue is fixed by changing the commented out line to the line after:

while [ -h "$WHEREAMI" ]; do
  # WHEREAMI=$(dirname "$WHEREAMI")"/"$(readlink "$WHEREAMI")
  WHEREAMI=$(readlink "$WHEREAMI")
done

hopefully this helps.

No available formula when installing via brew.

Gave following command a go from the project homepage, and saw the following:

~|⇒ brew install fpp
Error: No available formula for fpp
Searching formulae...
Searching taps...
~|⇒

Allow specifying command as an argument to fpp

Would this be possible? Something like:

git status | fpp -c 'git add'

So that the default action is overridden and I can just hit 'enter' after selecting files to run git add on them.

Use Python2 when available

In the two systems I use python is already pointing to 3.x whereas python2 is used as a fallback. I believe it's good to select python2 to run if it's available in the system.

Git installation troubles

I have a couple issues with the installation via git. I'm on OS X 10.10.3 with Python 2.7.6.

  1. The installation instructions create a cyclic symbolic link: ls -ltr | tail -n 1

lrwxr-xr-x (etc) fpp -> ./fpp

Adjusting the ln command to use the full path for the source fixes that.

  1. After the symbolic link is setup correctly I get the following error when running fpp --help:

/usr/local/bin/fpp: line 18: cd: /usr/local/bin//usr/local/PathPicker: No such file or directory
python: can't open file '/src/printHelp.py': [Errno 2] No such file or directory

I have placed PathPicker in /usr/local/PathPicker and linked the binary to /usr/local/bin/fpp.

_curses.error: curs_set() returned ERR

In rxvt-unicode, I hit this every time I try switching to command mode:

Traceback (most recent call last):
  File "PathPicker/src/choose.py", line 58, in <module>
    curses.wrapper(doProgram)
  File "7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "PathPicker/src/choose.py", line 30, in doProgram
    screen.control()
  File "PathPicker/src/screenControl.py", line 271, in control
    self.processInput(inKey)
  File "PathPicker/src/screenControl.py", line 344, in processInput
    self.beginEnterCommand()
  File "PathPicker/src/screenControl.py", line 434, in beginEnterCommand
    self.helperChrome.output(self.mode)
  File "PathPicker/src/screenControl.py", line 62, in output
    curses.curs_set(BLOCK_CURSOR)
_curses.error: curs_set() returned ERR

The man page seems to indicate that the terminal doesn't support that setting, and it does work fine in xterm.

PathPicker could be pure Python (no bash script)

@zmwangx posted an example script of this:

https://gist.github.com/zmwangx/23806da530a39bb1c0cf

Rather than use bash to redirect stdin and connect to tty, we could do it all in pure python. Not sure what the big benefits would be here besides not having to mix languages and all of that (and easier option handling).

It was pure python we could distribute via pip which means easy installation for linux users, but then we would have duplication between homebrew and pip which is discouraged. should file to historical reasons though

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.