[lastbash-cvs] SF.net SVN: lastbash: [225] releases
Status: Beta
Brought to you by:
cstroie
From: <cs...@us...> - 2007-03-23 11:31:36
|
Revision: 225 http://lastbash.svn.sourceforge.net/lastbash/?rev=225&view=rev Author: cstroie Date: 2007-03-23 04:31:35 -0700 (Fri, 23 Mar 2007) Log Message: ----------- Created the 0.3.2 release. Added Paths: ----------- releases/lastbash-0.3.2/ Removed Paths: ------------- releases/lastbash-0.3.2/lastbash.bash_completion Copied: releases/lastbash-0.3.2 (from rev 224, lastbash) Deleted: releases/lastbash-0.3.2/lastbash.bash_completion =================================================================== --- lastbash/lastbash.bash_completion 2007-03-23 11:27:54 UTC (rev 224) +++ releases/lastbash-0.3.2/lastbash.bash_completion 2007-03-23 11:31:35 UTC (rev 225) @@ -1,156 +0,0 @@ -# LastBASH bash_completion file -# Copyright (C) 2006 Costin Stroie <cs...@us...> -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# -# $Id$ - -function _lastbash() -{ - local current prev list - - COMPREPLY=() - current=${COMP_WORDS[COMP_CWORD]} - prev=${COMP_WORDS[COMP_CWORD-1]} - cmd="${COMP_WORDS[0]}" - - #echo "CURRENT: $current" >> /tmp/comp - - if [ "$prev" == -g ] - then - list="$($cmd -g help)" - elif [ "$prev" == -p ] - then - list="$($cmd -p help)" - elif [ "$prev" == -c ] - then - list="SKIP BAN LOVE REFRESH RTP DISCOVERY DEBUG WINCH QUIT" - elif [ "$prev" == -r ] - then - list="" - else - if [[ "$current" == -* ]] - then - list="-a -A -d -g -p -r -u -c -v -h" - elif [[ "$current" =~ ^lastfm:// ]] - then - _lastbash_url - return 0 - else - list="lastfm://" - fi - fi - - if [ "$list" ] - then - COMPREPLY=( $(compgen -W "$list" -- $current) ) - else - COMPREPLY=() - fi - return 0 -} - -function _lastbash_url() -{ - local C L S - declare -a U - if [ "$current" == "lastfm://" ] - then - C="" - else - C="${current%/}" - C="${C##*/}" - fi - - #echo "C: ${C}" >> /tmp/comp - - S="${current##lastfm://}" - U=(${S//\// }) - #echo "U: ${U}" >> /tmp/comp - #echo "U#: ${#U[@]}" >> /tmp/comp - - if [ "${U[0]}" ] - then - case "${U[0]}" in - "globaltags") - if [ "${U[1]}" ] - then - L="" - else - L="rock metal progressive" - fi - ;; - "group") - if [ "${U[1]}" ] - then - L="" - else - L="LastBASH Linux Amarok" - fi - ;; - "user") - if [ "${U[1]}" ] - then - if [ "${U[2]}" ] - then - L="" - else - L="recommended neighbours personal loved" - fi - else - L="cstroie mscarlat dbordeanu" - fi - ;; - "usertags") - if [ "${U[1]}" ] - then - if [ "${U[2]}" ] - then - L="" - else - L="rock metal guitar" - fi - else - L="RJ" - fi - ;; - "artist") - if [ "${U[1]}" ] - then - if [ "${U[2]}" ] - then - L="" - else - L="similarartists fans" - fi - else - L="Rammstein Pink%20Floyd Yes" - fi - ;; - "play") - if [ "${U[1]}" ] - then - L="" - else - L="tracks" - fi - ;; - *) - L="globaltags group user usertags artist play" - ;; - esac - else - L="globaltags group user usertags artist play" - fi - #echo "L: ${L}" >> /tmp/comp - - - COMPREPLY=( $(compgen -W "$L" -- $C) ) - - #echo "COMPLETION: ${COMPREPLY[@]}" >> /tmp/comp - #COMPREPLY=() -} - -complete -F _lastbash lastbash This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |