1
# sitecopy(1) completion
1
# sitecopy(1) completion -*- shell-script -*-
2
2
# Copyright 2003 Eelco Lempsink <eelcolempsink@gmx.net>
3
# 2011 Raphaël Droz <raphael.droz+floss@gmail.com>
3
4
# License: GNU GPL v2 or later
8
local cur prev words cword split
9
_init_completion -s || return
11
_get_comp_words_by_ref cur
13
COMPREPLY=( $( compgen -W "socket files rcfile ftp http httpbody
14
rsh sftp xml xmlparse cleartext" -- "$cur" ) )
18
--logfile|-g|--rcfile|-r)
15
COMPREPLY=( $( compgen -W "$(sitecopy -h | command grep -e '--\w' |\
16
awk '{sub (/=(FILE|PATH)/, "", $2); print $2}')" -- "$cur" ) )
19
COMPREPLY=( $( compgen -W "$(sitecopy -h | command grep -e '-\w' | \
20
awk '{sub (",", "", $1); print $1}')" -- "$cur" ) )
23
if [ -r ~/.sitecopyrc ]; then
24
COMPREPLY=( $( compgen -W "$(command grep '^["$'\t '"]*site' \
25
~/.sitecopyrc | awk '{print $2}')" -- "$cur" ) )
30
COMPREPLY=( $( compgen -W "$(_parse_help $1)" -- "$cur" ) )
31
[[ $COMPREPLY == *= ]] && compopt -o nospace
35
# only complete long options
43
if [[ -r ~/.sitecopyrc ]]; then
44
COMPREPLY=( $( compgen -W "$($1 -v | \
45
command sed -n '/^Site:/s/Site: //p')" -- "$cur" ) )
32
49
complete -F _sitecopy -o default sitecopy
37
# sh-indent-comment: t
38
# indent-tabs-mode: nil
40
51
# ex: ts=4 sw=4 et filetype=sh