From 8e6aaa2ecbe707505280e2f8486825ee969f267f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Adam=20Go=C5=82=C4=99biowski?= Date: Sun, 27 Jul 2008 08:56:39 +0000 Subject: [PATCH 1/1] - new Changed files: bash-completion-pear.spec -> 1.1 pear -> 1.1 --- bash-completion-pear.spec | 35 ++++++++ pear | 174 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 209 insertions(+) create mode 100644 bash-completion-pear.spec create mode 100644 pear diff --git a/bash-completion-pear.spec b/bash-completion-pear.spec new file mode 100644 index 0000000..87c46f7 --- /dev/null +++ b/bash-completion-pear.spec @@ -0,0 +1,35 @@ +Summary: bash-completion for PEAR +Summary(pl.UTF-8): bashowe uzupełnianie nazw dla PEAR +Name: bash-completion-pear +Version: 0.20080727 +Release: 1 +License: GPL +Group: Applications/Shells +Source0: http://gluegadget.com/misc/pear +# NoSource0-md5: +URL: http://gluegadget.com/blog/index.php?/archives/27-PEAR-bash-completion.html +Requires: bash-completion +Requires: php-pear-PEAR +BuildArch: noarch +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) + +%define _sysconfdir /etc/bash_completion.d + +%description +bash-completion for PEAR. + +%description -l pl.UTF-8 +bashowe uzupełnianie nazw dla PEAR. + +%prep + +%install +rm -rf $RPM_BUILD_ROOT +install -D %{SOURCE0} $RPM_BUILD_ROOT%{_sysconfdir}/pear-completion + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(644,root,root,755) +%{_sysconfdir}/* diff --git a/pear b/pear new file mode 100644 index 0000000..73f85dd --- /dev/null +++ b/pear @@ -0,0 +1,174 @@ +# pear completion by Amir Mohammad Saied + +_pear() +{ + local cur prev commands + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + commands='build bundle channel-add channel-alias channel-delete \ + channel-discover channel-info channel-update clear-cache \ + config-create config-get config-help config-set config-show convert \ + cvsdiff cvstag download download-all help info install list list-all \ + list-channels list-files list-upgrades login logout makerpm package \ + package-dependencies package-validate pickle remote-info remote-list \ + run-scripts run-tests search shell-tests sign uninstall update-channels upgrade upgrade-all' + + case "${prev}" in + build) + _filedir + return 0 + ;; + bundle) + if [[ "${cur}" == -* ]] ; then + COMPREPLY=( $(compgen -W "-d -f --destination --force" -- ${cur}) ) + fi + return 0 + ;; + channel-@(alias|delete|info|update)) + _discovered_channels + return 0 + ;; + convert) + _filedir + if [[ "${cur}" == -* ]] ; then + COMPREPLY=( $(compgen -W "-f --flat" -- ${cur}) ) + fi + return 0 + ;; + cvsdiff) + if [[ "${cur}" == -* ]] ; then + COMPREPLY=( $(compgen -W "-q -Q -D -R -r -c -u -i -b -B -n \ + --quiet --reallyquiet --date --release --revision \ + --context --unified --ignore-case --ignore-whitespace \ + --ignore-blank-lines --brief --dry-run" -- ${cur}) ) + fi + _filedir + return 0 + ;; + cvstag) + if [[ "${cur}" == -* ]] ; then + COMPREPLY=( $(compgen -W "-q -Q -F -d -n --quiet \ + --reallyquiet --slide --delete--dry-run" -- ${cur}) ) + fi + _filedir + return 0 + ;; + download) + if [[ "${cur}" == -* ]] ; then + COMPREPLY=( $(compgen -W "-Z --nocompress" -- ${cur}) ) + fi + return 0 + ;; + download-all|remote-list) + if [[ "${cur}" == -* ]] ; then + COMPREPLY=( $(compgen -W "-c --channel" -- ${cur}) ) + fi + return 0 + ;; + install) + if [[ "${cur}" == -* ]] ; then + COMPREPLY=( $(compgen -W "-f -l -n -r -s -B -Z -R -P -a -o \ + -O -p --force --loose --nodeps --register-only --soft \ + --nobuild --nocompress --installroot --ignore-errors \ + --alldeps --onlyreqdeps --offline --pretend" -- ${cur}) ) + fi + return 0 + ;; + list|search) + if [[ "${cur}" == -* ]] ; then + COMPREPLY=( $(compgen -W "-c -a -i --channel --allchannels --channelinfo" -- ${cur}) ) + else + local packages=$(for p in `pear list | tail --lines=+4 | cut -d' ' -f1`; do echo ${p} ; done ) + COMPREPLY=( $(compgen -W "${packages}" -- ${cur}) ) + fi + return 0 + ;; + list-all) + if [[ "${cur}" == -* ]] ; then + COMPREPLY=( $(compgen -W "-c -i --channel --channelinfo" -- ${cur}) ) + fi + return 0 + ;; + list-files) + local packages=$(for p in `pear list | tail --lines=+4 | cut -d' ' -f1`; do echo ${p} ; done ) + COMPREPLY=( $(compgen -W "${packages}" -- ${cur}) ) + return 0 + ;; + list-upgrades) + if [[ "${cur}" == -* ]] ; then + COMPREPLY=( $(compgen -W "-i --channelinfo" -- ${cur}) ) + fi + return 0 + ;; + login) + _discovered_channels + return 0 + ;; + makerpm) + if [[ "${cur}" == -* ]] ; then + COMPREPLY=( $(compgen -W "-t -p --spec-template --rpm-pkgname" -- ${cur}) ) + fi + _filedir + return 0 + ;; + p@(ackage|ickle)) + if [[ "${cur}" == -* ]] ; then + COMPREPLY=( $(compgen -W "-Z -n --nocompress --showname" -- ${cur}) ) + fi + _filedir + return 0 + ;; + package-@(dependencies|validate)) + _filedir + return 0 + ;; + run-tests) + if [[ "${cur}" == -* ]] ; then + COMPREPLY=( $(compgen -W "-r -i -l -q -s -p -u -t -c -x \ + --recur --ini --realtimelog --quiet --simple --package \ + --phpunit --tapoutput --cgi --coverage" -- ${cur}) ) + fi + return 0 + ;; + sign) + if [[ "${cur}" == -* ]] ; then + COMPREPLY=( $(compgen -W "-v --verbose" -- ${cur}) ) + fi + _filedir + return 0 + ;; + u@(ninstall|pgrade)|run-scripts) + _installed_packages + return 0 + ;; + upgrade-all) + if [[ "${cur}" == -* ]] ; then + COMPREPLY=( $(compgen -W "-n -r -B -Z -R --nodeps \ + --register-only --nobuild --nocompress --installroot \ + --ignore-errors --loose" -- ${cur}) ) + fi + return 0 + ;; + *) + ;; + esac + + COMPREPLY=($(compgen -W "${commands}" -- ${cur})) + return 0 +} + +_installed_packages() +{ + local packages=$(for p in `pear list | tail --lines=+4 | cut -d' ' -f1`; do echo ${p} ; done ) + COMPREPLY=( $(compgen -W "${packages}" -- ${cur}) ) +} + +_discovered_channels() +{ + local channels=$(for c in `pear list-channels | tail --lines=+4 | grep -v __uri | cut -d' ' -f1`; do echo ${c} ; done ) + COMPREPLY=( $(compgen -W "${channels}" -- ${cur}) ) + +} + +complete -F _pear pear -- 2.43.0