zsh-workers
 help / color / mirror / code / Atom feed
bb86f7bfc95e6e9a22141bd45b9deb83cfa3c060 blob 1708 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
 
#compdef twidge
## completion for twidge 1.0.8, based on twidge(1)

function _twidge_command {
	typeset -a twidge_commands
	typeset -i skip=1

	twidge lscommands | while read cmd desc; do
		if [[ $cmd == ---* ]] {
			skip=0
			continue
		}
		if (( skip )) {
			continue
		}
		twidge_commands+="${cmd}:${desc}"
	done

	_describe command twidge_commands
}

function _twidge_args {
	typeset -a args_common args_more args_other args_update

	args_common=(
		'(-a --all)'{-a,--all}'[receive all content]'
		'(-e --exec)'{-e,--exec}'[execute command for each retrieved item]:command'
		'(-l --long)'{-l,--long}'[long output format]'
		'(-m --mailto)'{-m,--mailto}'[mail retrieved items]:mail address'
	)

	args_more=(
		'(-s --saveid)'{-s,--saveid}'[save ID of most recent message]'
		'(-u --unseen)'{-u,--unseen}'[only show unseen messages]'
	)

	args_other=(
		'(-U --username)'{-U,--username}'[show updates of different user]:username'
	)

	args_update=(
		'(-i --inreplyto)'{-i,--inreplyto}'[update in reply to a message]:message id'
		'(-i --inreplyto 1)-r[read RFC2822 Mail]'
		':status'
	)

	case ${words[1]} in
		lsarchive)
			_arguments $args_common $args_more $args_other
			;;
		(ls(dm(|archive)|recent|replies|rt(|archive|replies)))
			_arguments $args_common $args_more
			;;
		(lsfollow(ers|ing))
			_arguments $args_common :username
			;;
		dmsend)
			_arguments :recipient :status
			;;
		((un|)follow)
			_message username
			;;
		update)
			_arguments $args_update
			;;
	esac
}

function _twidge {
	_arguments \
	'(-c --config)'{-c,--config}'[config file]:file:_files' \
	'(-d --debug)'{-d,--debug}'[enable debugging output]' \
	'(-): :_twidge_command' \
	'(-)*:: :_twidge_args'
}

_twidge "$@"
debug log:

solving bb86f7b ...
found bb86f7b in https://inbox.vuxu.org/zsh-workers/1432017889-21585-1-git-send-email-mikachu@gmail.com/
found d8b3b3d in https://git.vuxu.org/mirror/zsh/
preparing index
index prepared:
100644 d8b3b3def39bc490faf11965681928cd5b38d0eb	Completion/Unix/Command/_twidge

applying [1/1] https://inbox.vuxu.org/zsh-workers/1432017889-21585-1-git-send-email-mikachu@gmail.com/
diff --git a/Completion/Unix/Command/_twidge b/Completion/Unix/Command/_twidge
index d8b3b3d..bb86f7b 100644

Checking patch Completion/Unix/Command/_twidge...
Applied patch Completion/Unix/Command/_twidge cleanly.

index at:
100644 bb86f7bfc95e6e9a22141bd45b9deb83cfa3c060	Completion/Unix/Command/_twidge

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).