Initial class construction
This commit is contained in:
1 parent
67f2d57e03
commit
431ff5f7d4
5813 files changed
+1622108
No files matched your search
@@ -0,0 +1,55 @@
|
||||
|
||||
# Check for bash
|
||||
[ -z "$BASH_VERSION" ] && return
|
||||
|
||||
####################################################################################################
|
||||
|
||||
__app() {
|
||||
case "${COMP_CWORD}" in
|
||||
1)
|
||||
COMPREPLY=($(compgen -W "help version list-apps launch action list-actions" -- "${COMP_WORDS[1]}"))
|
||||
return 0
|
||||
;;
|
||||
|
||||
2)
|
||||
case "${COMP_WORDS[1]}" in
|
||||
launch|action|list-actions)
|
||||
COMPREPLY=($(compgen -W "`gapplication list-apps`" -- "${COMP_WORDS[2]}"))
|
||||
return 0
|
||||
;;
|
||||
|
||||
*)
|
||||
COMPREPLY=()
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
# Otherwise, what we will do is based on the command in ${COMP_WORDS[1]}
|
||||
case "${COMP_WORDS[1]}" in
|
||||
action)
|
||||
# Word 3 is the action name. This is the only one we can help with.
|
||||
if [ "${COMP_CWORD}" == 3 ]; then
|
||||
COMPREPLY=($(compgen -W "`gapplication list-actions "${COMP_WORDS[2]}"`" -- "${COMP_WORDS[3]}"))
|
||||
return 0
|
||||
else
|
||||
COMPREPLY=()
|
||||
return 0
|
||||
fi
|
||||
;;
|
||||
launch)
|
||||
# Filenames...
|
||||
COMPREPLY=($(compgen -A file "${COMP_WORDS[COMP_CWORD]}"))
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
# Nothing else should be out this far...
|
||||
COMPREPLY=()
|
||||
return 0
|
||||
esac
|
||||
}
|
||||
|
||||
####################################################################################################
|
||||
|
||||
complete -F __app gapplication
|
||||
@@ -0,0 +1,33 @@
|
||||
|
||||
# Check for bash
|
||||
[ -z "$BASH_VERSION" ] && return
|
||||
|
||||
####################################################################################################
|
||||
|
||||
|
||||
__gdbus() {
|
||||
local IFS=$'\n'
|
||||
local cur=`_get_cword :`
|
||||
|
||||
local suggestions=$(gdbus complete "${COMP_LINE}" ${COMP_POINT})
|
||||
COMPREPLY=($(compgen -W "$suggestions" -- "$cur"))
|
||||
|
||||
# Remove colon-word prefix from COMPREPLY items
|
||||
case "$cur" in
|
||||
*:*)
|
||||
case "$COMP_WORDBREAKS" in
|
||||
*:*)
|
||||
local colon_word=${cur%${cur##*:}}
|
||||
local i=${#COMPREPLY[*]}
|
||||
while [ $((--i)) -ge 0 ]; do
|
||||
COMPREPLY[$i]=${COMPREPLY[$i]#"$colon_word"}
|
||||
done
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
####################################################################################################
|
||||
|
||||
complete -o nospace -F __gdbus gdbus
|
||||
@@ -0,0 +1,58 @@
|
||||
|
||||
# Check for bash
|
||||
[ -z "$BASH_VERSION" ] && return
|
||||
|
||||
####################################################################################################
|
||||
|
||||
__gresource() {
|
||||
local choices coffset section
|
||||
|
||||
if [ ${COMP_CWORD} -gt 2 ]; then
|
||||
if [ ${COMP_WORDS[1]} = --section ]; then
|
||||
section=${COMP_WORDS[2]}
|
||||
coffset=2
|
||||
else
|
||||
coffset=0
|
||||
fi
|
||||
else
|
||||
coffset=0
|
||||
fi
|
||||
|
||||
case "$((${COMP_CWORD}-$coffset))" in
|
||||
1)
|
||||
choices=$'--section \nhelp \nsections \nlist \ndetails \nextract '
|
||||
;;
|
||||
|
||||
2)
|
||||
case "${COMP_WORDS[$(($coffset+1))]}" in
|
||||
--section)
|
||||
return 0
|
||||
;;
|
||||
|
||||
help)
|
||||
choices=$'sections\nlist\ndetails\nextract'
|
||||
;;
|
||||
|
||||
sections|list|details|extract)
|
||||
COMPREPLY=($(compgen -f -- ${COMP_WORDS[${COMP_CWORD}]}))
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
3)
|
||||
case "${COMP_WORDS[$(($coffset+1))]}" in
|
||||
list|details|extract)
|
||||
choices="$(gresource list ${COMP_WORDS[$(($coffset+2))]} 2> /dev/null | sed -e 's.$. .')"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
local IFS=$'\n'
|
||||
COMPREPLY=($(compgen -W "${choices}" -- "${COMP_WORDS[${COMP_CWORD}]}"))
|
||||
}
|
||||
|
||||
####################################################################################################
|
||||
|
||||
complete -o nospace -F __gresource gresource
|
||||
@@ -0,0 +1,84 @@
|
||||
|
||||
# Check for bash
|
||||
[ -z "$BASH_VERSION" ] && return
|
||||
|
||||
####################################################################################################
|
||||
|
||||
__gsettings() {
|
||||
local choices coffset schemadir
|
||||
|
||||
if [ ${COMP_CWORD} -gt 2 ]; then
|
||||
if [ ${COMP_WORDS[1]} = --schemadir ]; then
|
||||
# this complexity is needed to perform correct tilde expansion
|
||||
schemadir=$(eval "echo --schemadir ${COMP_WORDS[2]}")
|
||||
coffset=2
|
||||
else
|
||||
coffset=0
|
||||
fi
|
||||
else
|
||||
coffset=0
|
||||
fi
|
||||
|
||||
case "$((${COMP_CWORD}-$coffset))" in
|
||||
1)
|
||||
choices=$'--schemadir\n--version\nhelp \nlist-schemas\nlist-relocatable-schemas\nlist-keys \nlist-children \nlist-recursively \nget \nrange \nset \nreset \nreset-recursively \nwritable \nmonitor \ndescribe '
|
||||
;;
|
||||
|
||||
2)
|
||||
case "${COMP_WORDS[$(($coffset+1))]}" in
|
||||
--schemadir)
|
||||
COMPREPLY=($(compgen -o dirnames -- ${COMP_WORDS[${COMP_CWORD}]}))
|
||||
return 0
|
||||
;;
|
||||
|
||||
help)
|
||||
choices=$'list-schemas\nlist-relocatable-schemas\nlist-keys\nlist-children\nlist-recursively\nget\nrange\nset\nreset\nreset-recursively\nwritable\nmonitor'
|
||||
;;
|
||||
list-keys|list-children|list-recursively|reset-recursively)
|
||||
choices="$(gsettings $schemadir list-schemas)"$'\n'"$(gsettings $schemadir list-relocatable-schemas | sed -e 's.$.:/.')"
|
||||
;;
|
||||
|
||||
get|range|set|reset|writable|monitor|describe)
|
||||
choices="$(gsettings $schemadir list-schemas | sed -e 's.$. .')"$'\n'"$(gsettings $schemadir list-relocatable-schemas | sed -e 's.$.:/.')"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
3)
|
||||
case "${COMP_WORDS[$(($coffset+1))]}" in
|
||||
set)
|
||||
choices="$(gsettings $schemadir list-keys ${COMP_WORDS[$(($coffset+2))]} 2> /dev/null | sed -e 's.$. .')"
|
||||
;;
|
||||
|
||||
get|range|reset|writable|monitor|describe)
|
||||
choices="$(gsettings $schemadir list-keys ${COMP_WORDS[$(($coffset+2))]} 2> /dev/null)"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
4)
|
||||
case "${COMP_WORDS[$(($coffset+2))]}" in
|
||||
set)
|
||||
range=($(gsettings $schemadir range ${COMP_WORDS[$(($coffset+2))]} ${COMP_WORDS[$(($coffset+3))]} 2> /dev/null))
|
||||
case "${range[0]}" in
|
||||
enum)
|
||||
unset range[0]
|
||||
;;
|
||||
*)
|
||||
unset range
|
||||
;;
|
||||
esac
|
||||
local IFS=$'\n'
|
||||
choices="${range[*]}"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
local IFS=$'\n'
|
||||
COMPREPLY=($(compgen -W "${choices}" -- "${COMP_WORDS[${COMP_CWORD}]}"))
|
||||
}
|
||||
|
||||
####################################################################################################
|
||||
|
||||
complete -o nospace -F __gsettings gsettings
|
||||
@@ -0,0 +1,23 @@
|
||||
_sdk()
|
||||
{
|
||||
local cur prev opts
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
case "$prev" in
|
||||
build|cd|init)
|
||||
local projects=$(sdk valid_projects)
|
||||
COMPREPLY=($(compgen -W "$projects" -- $cur))
|
||||
return 0
|
||||
;;
|
||||
create-desktop-icon)
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
opts=$(sdk valid_commands)
|
||||
COMPREPLY=($(compgen -W "$opts" -- $cur))
|
||||
return 0
|
||||
}
|
||||
complete -F _sdk sdk
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,291 @@
|
||||
##
|
||||
# bash completion support for tig
|
||||
#
|
||||
# Copyright (C) 2007-2010 Jonas fonseca
|
||||
# Copyright (C) 2006,2007 Shawn Pearce
|
||||
#
|
||||
# Based git's git-completion.sh: http://repo.or.cz/w/git/fastimport.git
|
||||
#
|
||||
# The contained completion routines provide support for completing:
|
||||
#
|
||||
# *) local and remote branch names
|
||||
# *) local and remote tag names
|
||||
# *) tig 'subcommands'
|
||||
# *) tree paths within 'ref:path/to/file' expressions
|
||||
#
|
||||
# To use these routines:
|
||||
#
|
||||
# 1) Copy this file to somewhere (e.g. ~/.tig-completion.sh).
|
||||
# 2) Added the following line to your .bashrc:
|
||||
# source ~/.tig-completion.sh
|
||||
#
|
||||
# 3) You may want to make sure the git executable is available
|
||||
# in your PATH before this script is sourced, as some caching
|
||||
# is performed while the script loads. If git isn't found
|
||||
# at source time then all lookups will be done on demand,
|
||||
# which may be slightly slower.
|
||||
#
|
||||
|
||||
__tigdir ()
|
||||
{
|
||||
if [ -z "$1" ]; then
|
||||
if [ -n "$__git_dir" ]; then
|
||||
echo "$__git_dir"
|
||||
elif [ -d .git ]; then
|
||||
echo .git
|
||||
else
|
||||
git rev-parse --git-dir 2>/dev/null
|
||||
fi
|
||||
elif [ -d "$1/.git" ]; then
|
||||
echo "$1/.git"
|
||||
else
|
||||
echo "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
_tigcomp ()
|
||||
{
|
||||
local all c s=$'\n' IFS=' '$'\t'$'\n'
|
||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
if [ $# -gt 2 ]; then
|
||||
cur="$3"
|
||||
fi
|
||||
for c in $1; do
|
||||
case "$c$4" in
|
||||
--*=*) all="$all$c$4$s" ;;
|
||||
*.) all="$all$c$4$s" ;;
|
||||
*) all="$all$c$4 $s" ;;
|
||||
esac
|
||||
done
|
||||
IFS=$s
|
||||
COMPREPLY=($(compgen -P "$2" -W "$all" -- "$cur"))
|
||||
return
|
||||
}
|
||||
|
||||
__tig_refs ()
|
||||
{
|
||||
local cmd i is_hash=y dir="$(__tigdir "$1")"
|
||||
if [ -d "$dir" ]; then
|
||||
for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD; do
|
||||
if [ -e "$dir/$i" ]; then echo $i; fi
|
||||
done
|
||||
for i in $(git --git-dir="$dir" \
|
||||
for-each-ref --format='%(refname)' \
|
||||
refs/tags refs/heads refs/remotes); do
|
||||
case "$i" in
|
||||
refs/tags/*) echo "${i#refs/tags/}" ;;
|
||||
refs/heads/*) echo "${i#refs/heads/}" ;;
|
||||
refs/remotes/*) echo "${i#refs/remotes/}" ;;
|
||||
*) echo "$i" ;;
|
||||
esac
|
||||
done
|
||||
return
|
||||
fi
|
||||
for i in $(git-ls-remote "$dir" 2>/dev/null); do
|
||||
case "$is_hash,$i" in
|
||||
y,*) is_hash=n ;;
|
||||
n,*^{}) is_hash=y ;;
|
||||
n,refs/tags/*) is_hash=y; echo "${i#refs/tags/}" ;;
|
||||
n,refs/heads/*) is_hash=y; echo "${i#refs/heads/}" ;;
|
||||
n,refs/remotes/*) is_hash=y; echo "${i#refs/remotes/}" ;;
|
||||
n,*) is_hash=y; echo "$i" ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
__tig_complete_file ()
|
||||
{
|
||||
local pfx ls ref cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
case "$cur" in
|
||||
?*:*)
|
||||
ref="${cur%%:*}"
|
||||
cur="${cur#*:}"
|
||||
case "$cur" in
|
||||
?*/*)
|
||||
pfx="${cur%/*}"
|
||||
cur="${cur##*/}"
|
||||
ls="$ref:$pfx"
|
||||
pfx="$pfx/"
|
||||
;;
|
||||
*)
|
||||
ls="$ref"
|
||||
;;
|
||||
esac
|
||||
COMPREPLY=($(compgen -P "$pfx" \
|
||||
-W "$(git --git-dir="$(__tigdir)" ls-tree "$ls" \
|
||||
| sed '/^100... blob /s,^.* ,,
|
||||
/^040000 tree /{
|
||||
s,^.* ,,
|
||||
s,$,/,
|
||||
}
|
||||
s/^.* //')" \
|
||||
-- "$cur"))
|
||||
;;
|
||||
*)
|
||||
_tigcomp "$(__tig_refs)"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__tig_complete_revlist ()
|
||||
{
|
||||
local pfx cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
case "$cur" in
|
||||
*...*)
|
||||
pfx="${cur%...*}..."
|
||||
cur="${cur#*...}"
|
||||
_tigcomp "$(__tig_refs)" "$pfx" "$cur"
|
||||
;;
|
||||
*..*)
|
||||
pfx="${cur%..*}.."
|
||||
cur="${cur#*..}"
|
||||
_tigcomp "$(__tig_refs)" "$pfx" "$cur"
|
||||
;;
|
||||
*.)
|
||||
_tigcomp "$cur."
|
||||
;;
|
||||
*)
|
||||
_tigcomp "$(__tig_refs)"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_tig_options ()
|
||||
{
|
||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
case "$cur" in
|
||||
--pretty=*)
|
||||
_tigcomp "
|
||||
oneline short medium full fuller email raw
|
||||
" "" "${cur##--pretty=}"
|
||||
return
|
||||
;;
|
||||
--*)
|
||||
_tigcomp "
|
||||
--max-count= --max-age= --since= --after=
|
||||
--min-age= --before= --until=
|
||||
--root --not --topo-order --date-order
|
||||
--no-merges
|
||||
--abbrev-commit --abbrev=
|
||||
--relative-date
|
||||
--author= --committer= --grep=
|
||||
--all-match
|
||||
--pretty= --name-status --name-only
|
||||
--not --all
|
||||
--help --version
|
||||
"
|
||||
return
|
||||
;;
|
||||
-*)
|
||||
_tigcomp "-v -h"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
__tig_complete_revlist
|
||||
}
|
||||
|
||||
_tig_blame ()
|
||||
{
|
||||
local reply="" ref=HEAD cur="${COMP_WORDS[COMP_CWORD]}" p=""
|
||||
local pfx=$(git rev-parse --show-prefix 2>/dev/null)
|
||||
|
||||
if test "$COMP_CWORD" -lt 3; then
|
||||
_tigcomp "$(__tig_refs)"
|
||||
else
|
||||
ref="${COMP_WORDS[2]}"
|
||||
fi
|
||||
|
||||
case "$cur" in
|
||||
*/) p=${cur%/} ;;
|
||||
*/*) p=${cur%/*} ;;
|
||||
*) p= ;;
|
||||
esac
|
||||
|
||||
i=${#COMPREPLY[@]}
|
||||
local IFS=$'\n'
|
||||
for c in $(git --git-dir="$(__tigdir)" ls-tree "$ref:$pfx$p" 2>/dev/null |
|
||||
sed -n '/^100... blob /{
|
||||
s,^.* ,,
|
||||
s,$, ,
|
||||
p
|
||||
}
|
||||
/^040000 tree /{
|
||||
s,^.* ,,
|
||||
s,$,/,
|
||||
p
|
||||
}')
|
||||
do
|
||||
c="${p:+$p/}$c"
|
||||
if [[ "$c" == "$cur"* ]]; then
|
||||
COMPREPLY[i++]=$c
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
_tig_show ()
|
||||
{
|
||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
case "$cur" in
|
||||
--pretty=*)
|
||||
_tigcomp "
|
||||
oneline short medium full fuller email raw
|
||||
" "" "${cur##--pretty=}"
|
||||
return
|
||||
;;
|
||||
--*)
|
||||
_tigcomp "--pretty="
|
||||
return
|
||||
;;
|
||||
esac
|
||||
__tig_complete_file
|
||||
}
|
||||
|
||||
_tig ()
|
||||
{
|
||||
local i c=1 command __tig_dir
|
||||
|
||||
while [ $c -lt $COMP_CWORD ]; do
|
||||
i="${COMP_WORDS[c]}"
|
||||
case "$i" in
|
||||
--) command="log"; break;;
|
||||
-*) ;;
|
||||
*) command="$i"; break ;;
|
||||
esac
|
||||
c=$((++c))
|
||||
done
|
||||
|
||||
if [ $c -eq $COMP_CWORD -a -z "$command" ]; then
|
||||
case "${COMP_WORDS[COMP_CWORD]}" in
|
||||
--*=*) COMPREPLY=() ;;
|
||||
-*) _tig_options ;;
|
||||
*) _tigcomp "blame status show log stash grep $(__tig_refs)" ;;
|
||||
esac
|
||||
return
|
||||
fi
|
||||
|
||||
case "$command" in
|
||||
blame) _tig_blame ;;
|
||||
show) _tig_show ;;
|
||||
status) ;;
|
||||
*) _tigcomp "
|
||||
$(__tig_complete_file)
|
||||
$(__tig_refs)
|
||||
" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Detect if current shell is ZSH, and if so, load this file in bash
|
||||
# compatibility mode.
|
||||
if [ -n "$ZSH_VERSION" ]; then
|
||||
autoload bashcompinit
|
||||
bashcompinit
|
||||
fi
|
||||
|
||||
complete -o default -o nospace -F _tig tig
|
||||
|
||||
# The following are necessary only for Cygwin, and only are needed
|
||||
# when the user has tab-completed the executable name and consequently
|
||||
# included the '.exe' suffix.
|
||||
if [ Cygwin = "$(uname -o 2>/dev/null)" ]; then
|
||||
complete -o default -o nospace -F _tig tig.exe
|
||||
fi
|
||||
@@ -0,0 +1,36 @@
|
||||
# Author: Ciaran McCreesh <ciaranm@gentoo.org>
|
||||
#
|
||||
# completion for vim
|
||||
|
||||
_vim()
|
||||
{
|
||||
local cur prev cmd args
|
||||
|
||||
COMPREPLY=()
|
||||
cur=${COMP_WORDS[COMP_CWORD]}
|
||||
prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
cmd=${COMP_WORDS[0]}
|
||||
|
||||
if [[ "${prev}" == "--servername" ]] ; then
|
||||
local servers
|
||||
servers=$(gvim --serverlist )
|
||||
COMPREPLY=( $( compgen -W "${servers}" -- $cur ) )
|
||||
|
||||
elif [[ "${prev}" == -[uUi] ]] ; then
|
||||
COMPREPLY=( $( compgen -W "NONE" ) \
|
||||
$( compgen -f -X "!*vim*" -- "$cur" ) )
|
||||
|
||||
elif [[ "${cur}" == -* ]] ; then
|
||||
args='-t -q -c -S --cmd -A -b -C -d -D -e -E -f --nofork \
|
||||
-F -g -h -H -i -L -l -m -M -N -n -nb -o -R -r -s \
|
||||
-T -u -U -V -v -w -W -x -X -y -Y -Z --echo-wid \
|
||||
--help --literal --noplugin --version'
|
||||
COMPREPLY=( $( compgen -W "${args}" -- $cur ) )
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
}
|
||||
|
||||
complete -o filenames -F _vim vim ex view evim rvim rview
|
||||
|
||||
# vim: set ft=sh sw=4 et sts=4 :
|
||||
Reference in new issue
Block a user