Changeset - c18c26b14893
[Not reviewed]
default
0 4 1
Dennis Fink - 7 years ago 2013-05-19 20:14:09
the_metalgamer@hackerspace.lu
added autocompletion
5 files changed with 38 insertions and 31 deletions:
0 comments (0 inline, 0 general)
README.rst
Show inline comments
...
 
@@ -9,7 +9,7 @@ Yet another AUR helper
 
:Author:         Dennis Fink <the_metalgamer@hackerspace.lu>
 
:Date:           2013-03-04
 
:Copyright:      GPLv3+
 
:Version:        Yaah 0.3.1
 
:Version:        Yaah 0.3.2
 
:Manual section: 8
 
:Manual group:   Yaah Manual
 

	
man/man8/yaah.8.gz
Show inline comments
 
binary diff not shown
yaah
Show inline comments
 
#!/bin/bash -
 

	
 
#:        Title: yaah - Yet another AUR helper
 
#:     Synopsis: yaah [options] [packages]
 
#:               yaah (packages)
 
#:               yaah -s keywords
 
#:      Options: -h, --help                            Display help
 
#:               -c, --check                           Check installed, foreign
 
#:                                                     packages if there are
 
#:                                                     updates available
 
#:               -d directory, --downloaddir=directory Download packages to the
 
#:                                                     specified directory
 
#:               -s, --search                          Search for packages
 
#:                                                     containing specified
 
#:                                                     keyword
 
#:               -v, --verbose                         Be more verbose, can be
 
#:                                                     supplied at  maximum 2
 
#:                                                     times
 
#:               -q, --quiet                           Be less verbose. Takes
 
#:                                                     precedence over -v and
 
#:                                                     --verbose
 
#:     Synopsis: yaah [options] <packages>...
 
#:               yaah (packages)...
 
#:               yaah -s (keyword)
 
#:      Options:
 
#:               -h, --help                             Display help
 
#:               -c, --check                            Check installed, foreign packages if there are updates available
 
#:               -d DIRECTORY, --downloaddir=DIRECTORY  Download packages to the specified directory
 
#:               -s, --search                           Search for packages containing specified keyword
 
#:               -v, --verbose                          Be more verbose, can be supplied at  maximum 2 times
 
#:               -q, --quiet                            Be less verbose. Takes precedence over -v and --verbose
 
#: Requirements: jshon <http://kmkeen.com/jshon/>
 
#:      Version: 0.3.1
 
#:      Version: 0.3.2
 
#:      Created: 2013-02-26
 
#:     Revision: 2013-05-19
 
#:       Author: Dennis Fink <the_metalgamer@hackerspace.lu>
...
 
@@ -43,7 +35,7 @@ umask $UMASK
 
SCRIPTNAME=${0##*/}
 
DESCRIPTION="Yet another AUR helper"
 
DATE_OF_CREATION=2013-02-26
 
VERSION=0.3.1
 
VERSION=0.3.2
 
AUTHOR="Dennis Fink <the_metalgamer@hackerspace.lu>"
 

	
 
readonly SCRIPTNAME DESCRIPTION DATE_OF_CREATION VERSION AUTHOR
...
 
@@ -403,20 +395,21 @@ download () {
 
#==============================================================================
 

	
 
usage() {
 

	
 
    printf "$SCRIPTNAME - $VERSION - $DESCRIPTION
 

	
 
    Download packages from AUR or check installed, foreign packages, if there are updates available.
 

	
 
    Usage: $SCRIPTNAME [options] [packages]
 
           $SCRIPTNAME (packages)
 
    Usage:
 
      $SCRIPTNAME <packages>...
 
      $SCRIPTNAME [options] [<packages>]
 

	
 
    Options:
 
    -h, --help                              Display help
 
    -c, --check                             Check installed packages if there are updates
 
    -d directory, --downloaddir=directory   Download packages to the specified directory
 
    -s, --search                            Search for packages containing specified keywords
 
    -v, --verbose                           Be more verbose, can be supplied at maximum 2 times
 
    -q, --quiet                             Be less verbose. Takes precedence over -v and --verbose
 
      -h, --help                             Display help
 
      -c, --check                            Check installed, foreign packages if there are updates available
 
      -d DIRECTORY, --downloaddir=DIRECTORY  Download packages to the specified directory
 
      -s KEYWORD, --search KEYWORD           Search for packages containing specified keyword
 
      -v, --verbose                          Be more verbose, can be supplied at  maximum 2 times
 
      -q, --quiet                            Be less verbose. Takes precedence over -v and --verbose
 

	
 
    For complete documentation, run: man 8 yaah\n"
 
}
yaah.completion
Show inline comments
 
new file 100644
 
_yaah() {
 

	
 
    local cur prev opts
 
    COMPREPLY=()
 
    cur="${COMP_WORDS[COMP_CWORD]}"
 
    prev="${COMP_WORDS[COMP_CWORD-1]}"
 
    opts="-h --help -c --check -d --downloaddir -s --search -v --verbose -q --quiet"
 

	
 
    if [[ ${cur} == -* ]]; then
 
        COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
 
        return 0
 
    fi
 
}
 
complete -F _yaah yaah
yaah.rst
Show inline comments
...
 
@@ -9,7 +9,7 @@ Yet another AUR helper
 
:Author:         Dennis Fink <the_metalgamer@hackerspace.lu>
 
:Date:           2013-03-04
 
:Copyright:      GPLv3+
 
:Version:        Yaah 0.3.1
 
:Version:        Yaah 0.3.2
 
:Manual section: 8
 
:Manual group:   Yaah Manual
 

	
0 comments (0 inline, 0 general)