Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put your application-specific autocompletion ideas here #44

Open
1 of 8 tasks
GijsTimmers opened this issue Oct 23, 2014 · 2 comments
Open
1 of 8 tasks

Put your application-specific autocompletion ideas here #44

GijsTimmers opened this issue Oct 23, 2014 · 2 comments

Comments

@GijsTimmers
Copy link
Collaborator

  • apt
    Pressing Tab ↹ should yield:
    list search show install remove edit-sources update upgrade full-upgrade
  • apt-get
    Pressing Tab ↹ should yield:
    update upgrade install remove autoremove purge source build-dep dist-upgrade dselect-upgrade clean autoclean check changelog download
  • apt-cache
    Pressing Tab ↹ should yield:
    gencaches showpkg showsrc stats dump dumpavail unmet search show depends rdepends pkgnames dotty xvcg policy
  • ifconfig
    Pressing Tab ↹ should yield the various active internet connections:
    eth0 lo wlan0
  • zenity
    Pressing Tab ↹ should yield:
    --help-all --calendar --entry --error --info --file-selection --list --notification --progress --question --warning --scale --text-info --color-selection --password --forms
  • systemctl
    Pressing Tab ↹ should yield:
    start stop restart reload status is-enabled enable disable help daemon-reload
  • uname
    Pressing Tab ↹ should yield:
    --all --kernel-name --nodename --kernel-release --kernel-version --machine --processor --hardware-platform
  • git checkout
    Pressing Tab ↹ should yield all available branches.
@jovanbulck
Copy link
Owner

apt support done --> see branch
pacman support is on the way :p

@jovanbulck
Copy link
Owner

Status update:

Autocompletion in master

autocompletion support for built_ins, aliases and a number of predefined UNIX commands now in master + some custom completion for some UNIX commands: git, apt-get, make, jsh --> should be stable, report here if not

Writing custom autocompleters (developers, developers, developers)

Autocompletion functions ("generators") go into jsh-autocomplete.c. I documented this file quiet well, since I lost a lot of time trying to understand how readline works. Anyone who feels like adding autocompletion support for some (usefull) command => go ahead and open a pull request! Should't be too hard, as I wrote a friendly macro who does everything for you ;-) Check out some examples in jsh-autocomplete.c

Future work

for the autocompletion of UNIX command names: we should scan all directories in $PATH at startup-time and put all commands in an array for autocompletion. Currently only a hack: array with widely used UNIX commands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants