diff options
author | dakkar <dakkar@thenautilus.net> | 2009-09-07 11:58:23 +0200 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2009-09-07 11:58:23 +0200 |
commit | 772349cd4aa9f92080e26ffcdf8acb33312cc723 (patch) | |
tree | 24d48c77018b0425b4b309b009c5d29058acc277 /website.bashcomp | |
parent | fix spacing in translation (diff) | |
download | thenautilus-772349cd4aa9f92080e26ffcdf8acb33312cc723.tar.gz thenautilus-772349cd4aa9f92080e26ffcdf8acb33312cc723.tar.bz2 thenautilus-772349cd4aa9f92080e26ffcdf8acb33312cc723.zip |
bash programmable completion for new-* scripts
Diffstat (limited to 'website.bashcomp')
-rw-r--r-- | website.bashcomp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/website.bashcomp b/website.bashcomp new file mode 100644 index 0000000..ba04385 --- /dev/null +++ b/website.bashcomp @@ -0,0 +1,19 @@ +_website_newdoc() { + local dir='src' + local excl='[._]*' + if [[ "$COMP_CWORD" -gt 1 ]]; then + dir="${dir}/tags" + else + excl="@(${excl}|tags)" + fi + pushd "$dir" >/dev/null + COMPREPLY=($(compgen -o filenames -o nospace -d -X "$excl" -- "${COMP_WORDS[COMP_CWORD]}" | sed 's,$,/,')) + popd >/dev/null +} + +_website_newtag() { + false +} + +complete -o filenames -o nospace -F _website_newdoc ./new-doc +complete -o filenames -o nospace -F _website_newtag ./new-tag |