Roscidus.com Zero Install Mirror

» Main » bash-cached-completions

bash-cached-completions - cached completions for bash

Published by Tim Cuthbertson

Overview

This is a Zero Install feed. To add this program to your Applications menu, choose Zero Install -> Add New Program from the Applications menu. e.g. on Ubuntu:

Adding with GNOME

If you don't see this menu item, install the zeroinstall-injector package from your distribution's repository, or from 0install.net.

Drag the feed's URL to the dialog box that appears. Other environments may use other systems. For example, if you are a ROX desktop user, drag the link to AddApp instead.

Alternatively, to run it from the command-line:

$ 0launch http://gfxmonk.net/dist/0install/bashcomplete.xml

The 0alias command can be used to create a short-cut to run it again later.

If you don't have the 0launch command, download it from the 0install.net web-site, which also contains documentation about how the Zero Install system works.

Full name

http://gfxmonk.net/dist/0install/bashcomplete.xml

Homepage

http://github.com/gfxmonk/bash-cached-completions

Description

An easy way to generate a set of bash completion words. Word sets are cached, and generated in the background (so your terminal doesn't hang). The config is all written in python, because python is ace. Every set of words is tied to the cache_key you generate - if you return the same cache_key, the completion will re-use the same set of words. If completion depends on existing arguments, you will need to factor that into your cache_key generation. Cache_keys need to be valid filenames, so b32encode can be useful. Example setup: To enable completions for "my-command": ----------------------------------------- ~/.config/bashcomplete/my-command.py: max_age = 5 * 60 # 5 minutes def cache_key(command, args): import os import base64 return base64.b32encode(os.getcwd()) def get_words(command, args): import time time.sleep(2) # won't lock bash return ['aaa','bbbb','cccc', 'ccdd'] ----------------------------------------- ~/.bashrc: export PATH="$PATH:/path/to/bashcomplete" . /path/to/bashcomplete/init (Or, if you're using 0install) : ----------------------------------------- ~/.bashrc: . $(0launch -c http://gfxmonk.net/dist/0install/bashcomplete.xml __init)

Available versions

The list below is just for information; Zero Install will automatically select one of these versions for you.

VersionReleasedStabilityPlatformDownload
0.12010-06-13AnyDownload (1398 bytes)
0.1.12010-07-28AnyDownload (1489 bytes)
0.1.22010-07-29AnyDownload (1429 bytes)
0.1.32010-07-31AnyDownload (1438 bytes)
0.1.42010-08-07AnyDownload (1956 bytes)
0.1.52010-08-13AnyDownload (2059 bytes)
0.1.62010-11-13AnyDownload (4332 bytes)
0.1.72011-02-19AnyDownload (4434 bytes)
0.1.82012-02-05AnyDownload (4500 bytes)
0.1.92012-04-28AnyDownload (4503 bytes)
Required libraries

This feed does not list any additional requirements.