astrand / xclip

Command line interface to the X11 clipboard
GNU General Public License v2.0
1.04k stars 75 forks source link

Initial commit of Bash tab completion code. #68

Closed hackerb9 closed 3 years ago

hackerb9 commented 4 years ago

Working for all basic cases. Tab completion of filenames, all flags, all selections (case insensitive), and most TARGETS. ("Most" because this code cannot yet handle spaces in the property names.)

For example, below I typed "xclip -se TAB s TAB -t TAB TAB TAB"

$ xclip -selection Secondary -target 
COMPOUND_TEXT             TARGETS                   text/plain;charset=utf-8
MULTIPLE                  TEXT                      TIMESTAMP
STRING                    text/plain                UTF8_STRING

As you can see it looked up the targets available for the selection I mentioned and offers them up for completion.

Note: as a debian package, this file is supposed to install using dh_bash-completion, but I'm not exactly sure where to put that. Alternately, this could be copied by hand to /etc/bash_completion.d/ or even simply sourced at login.

hackerb9 commented 3 years ago

This merge is subsumed by #88.