Documentation/fSDN/eNetFpgaTutorial: netfpga-session-2011.03.11-from-scratch-NetFPGA-Openflow.txt

File netfpga-session-2011.03.11-from-scratch-NetFPGA-Openflow.txt, 3.3 MB (added by nkiran, 10 years ago)
Line 
1ls
2[0m[01;31momf-common-5.2_ubuntu2_all.deb[0m
3[m]0;root@node1-1.sb9.orbit-lab.org: ~root@node1-1:~# Write failed: Connection reset by peer
4
5]0;~
6
7[32mnkiran@magrathea [33m~[0m
8
9$ ssh sb9
10Linux console.sb9.orbit-lab.org 2.6.32-21-generic-pae #32-Ubuntu SMP Fri Apr 16 09:39:35 UTC 2010 i686 GNU/Linux
11Ubuntu 10.04.2 LTS
12
13Welcome to Ubuntu!
14 * Documentation: https://help.ubuntu.com/
15
16 System information as of Fri Mar 11 12:12:07 EST 2011
17
18 System load: 0.0 Swap usage: 0% Users logged in: 0
19 Usage of /: 6.0% of 14.67GB Temperature: 40 C
20 Memory usage: 3% Processes: 118
21
22 Graph this data and manage this system at https://landscape.canonical.com/
23
2410 packages can be updated.
256 updates are security updates.
26
27Last login: Fri Mar 11 10:04:42 2011 from 165.230.132.126
28
29nkiran@console:~$ ssh 1
30Last login: Fri Mar 11 15:09:23 2011 from consolec.sb9.orbit-lab.org
31
32]0;root@node1-1.sb9.orbit-lab.org: ~root@node1-1:~# ifconfig -a
33control Link encap:Ethernet HWaddr 00:15:17:d6:da:4b
34 inet addr:10.19.1.1 Bcast:10.19.255.255 Mask:255.255.0.0
35 inet6 addr: fe80::215:17ff:fed6:da4b/64 Scope:Link
36 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
37 RX packets:22427 errors:0 dropped:0 overruns:0 frame:0
38 TX packets:13793 errors:0 dropped:0 overruns:0 carrier:0
39 collisions:0 txqueuelen:1000
40 RX bytes:1982283 (1.9 MB) TX bytes:2359083 (2.3 MB)
41 Memory:febe0000-fec00000
42
43exp0 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
44 inet addr:192.168.11.5 Bcast:192.168.255.255 Mask:255.255.0.0
45 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
46 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
47 RX packets:17 errors:0 dropped:0 overruns:0 frame:0
48 TX packets:110 errors:0 dropped:0 overruns:0 carrier:0
49 collisions:0 txqueuelen:1000
50 RX bytes:1020 (1.0 KB) TX bytes:18862 (18.8 KB)
51 Memory:feb80000-feba0000
52
53exp0.1 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
54 inet addr:192.168.11.51 Bcast:192.168.255.255 Mask:255.255.0.0
55 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
56 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
57 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
58 TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
59 collisions:0 txqueuelen:0
60 RX bytes:0 (0.0 B) TX bytes:5597 (5.5 KB)
61
62exp0.2 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
63 inet addr:192.168.11.52 Bcast:192.168.255.255 Mask:255.255.0.0
64 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
65 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
66 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
67 TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
68 collisions:0 txqueuelen:0
69 RX bytes:0 (0.0 B) TX bytes:3148 (3.1 KB)
70
71exp0.3 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
72 inet addr:192.168.11.53 Bcast:192.168.255.255 Mask:255.255.0.0
73 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
74 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
75 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
76 TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
77 collisions:0 txqueuelen:0
78 RX bytes:0 (0.0 B) TX bytes:3063 (3.0 KB)
79
80exp0.4 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
81 inet addr:192.168.11.54 Bcast:192.168.255.255 Mask:255.255.0.0
82 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
83 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
84 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
85 TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
86 collisions:0 txqueuelen:0
87 RX bytes:0 (0.0 B) TX bytes:2883 (2.8 KB)
88
89lo Link encap:Local Loopback
90 inet addr:127.0.0.1 Mask:255.0.0.0
91 inet6 addr: ::1/128 Scope:Host
92 UP LOOPBACK RUNNING MTU:16436 Metric:1
93 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
94 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
95 collisions:0 txqueuelen:0
96 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
97
98nf2c0 Link encap:Ethernet HWaddr 00:4e:46:32:43:00
99 inet6 addr: fe80::24e:46ff:fe32:4300/64 Scope:Link
100 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
101 RX packets:11683 errors:0 dropped:0 overruns:0 frame:0
102 TX packets:11683 errors:0 dropped:0 overruns:0 carrier:0
103 collisions:0 txqueuelen:1000
104 RX bytes:17683778 (17.6 MB) TX bytes:17683778 (17.6 MB)
105 Interrupt:16
106
107nf2c1 Link encap:Ethernet HWaddr 00:4e:46:32:43:01
108 inet6 addr: fe80::24e:46ff:fe32:4301/64 Scope:Link
109 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
110 RX packets:11683 errors:0 dropped:0 overruns:0 frame:0
111 TX packets:11683 errors:0 dropped:0 overruns:0 carrier:0
112 collisions:0 txqueuelen:1000
113 RX bytes:17683778 (17.6 MB) TX bytes:17683778 (17.6 MB)
114 Interrupt:16
115
116nf2c2 Link encap:Ethernet HWaddr 00:4e:46:32:43:02
117 inet6 addr: fe80::24e:46ff:fe32:4302/64 Scope:Link
118 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
119 RX packets:11683 errors:0 dropped:0 overruns:0 frame:0
120 TX packets:11683 errors:0 dropped:0 overruns:0 carrier:0
121 collisions:0 txqueuelen:1000
122 RX bytes:17683778 (17.6 MB) TX bytes:17683778 (17.6 MB)
123 Interrupt:16
124
125nf2c3 Link encap:Ethernet HWaddr 00:4e:46:32:43:03
126 inet6 addr: fe80::24e:46ff:fe32:4303/64 Scope:Link
127 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
128 RX packets:11683 errors:0 dropped:0 overruns:0 frame:0
129 TX packets:11683 errors:0 dropped:0 overruns:0 carrier:0
130 collisions:0 txqueuelen:1000
131 RX bytes:17683778 (17.6 MB) TX bytes:17683778 (17.6 MB)
132 Interrupt:16
133
134]0;root@node1-1.sb9.orbit-lab.org: ~root@node1-1:~# exit
135logout
136Connection to node1-1 closed.
137
138nkiran@console:~$ ssh netfpga@1 [K
139netfpga@node1-1's password:
140Permission denied, please try again.
141
142netfpga@node1-1's password:
143Last login: Thu Mar 10 14:40:40 2011 from consolec.sb9.orbit-lab.org
144
145]0;netfpga@node1-1: ~netfpga@node1-1:~$ ls
146[0m[01;34mnetfpga[0m [01;34mpkgs[0m
147[m]0;netfpga@node1-1: ~netfpga@node1-1:~$ nf_download netfpga/bitfiles/reference_router.bit
148Found net device: nf2c0
149Bit file built from: nf2_top_par.ncd;HW_TIMEOUT=FALSE
150Part: 2vp50ff1152
151Date: 2011/ 1/20
152Time: 5:41:32
153Error Registers: 0
154Good, after resetting programming interface the FIFO is empty
155Download completed - 2377668 bytes. (expected 2377668).
156DONE went high - chip has been successfully programmed.
157CPCI Information
158----------------
159Version: 4 (rev 1)
160
161Device (Virtex) Information
162---------------------------
163Project directory: reference_router
164Project name: Reference router
165Project description: Reference IPv4 router
166
167Device ID: 2
168Version: 1.0.0
169Built against CPCI version: 4 (rev 1)
170
171Virtex design compiled against active CPCI version
172]0;netfpga@node1-1: ~netfpga@node1-1:~$ sudo bash[K[K[K[K[K[K[K[K[Knetfpga/bin/nf_regress_test.pl
173Can't locate NF/Base.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at netfpga/bin/nf_regress_test.pl line 3.
174BEGIN failed--compilation aborted at netfpga/bin/nf_regress_test.pl line 3.
175]0;netfpga@node1-1: ~netfpga@node1-1:~$
176]0;netfpga@node1-1: ~netfpga@node1-1:~$ ls netfpga/
177bashrc_addon CHANGES .gitignore Makefile
178bin/ doc/ lib/ projects/
179bitfiles/ .git/ LICENSE README
180]0;netfpga@node1-1: ~netfpga@node1-1:~$ ls netfpga/lib/Perl5/
181CPCI_Lib.pm EvtsLib.pm NF/ NFUtils/ SimLib.pm Test/
182]0;netfpga@node1-1: ~netfpga@node1-1:~$ ls netfpga/lib/Perl5/[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[Kecho $PERL5LIB
183
184]0;netfpga@node1-1: ~netfpga@node1-1:~$ ls /usr/local/netfpga/
185[0m[01;34mbitfiles[0m
186[m]0;netfpga@node1-1: ~netfpga@node1-1:~$ netfpga/lib/scripts/user_account_setup/user_account_setup.pl
187[A
188NetFPGA directory already exists copy has been canceled
189Adding the NetFPGA Enviornment Variables to your .bashrc
190cat: /usr/local/netfpga/bashrc_addon: No such file or directory
191]0;netfpga@node1-1: ~netfpga@node1-1:~$ cat [K[K[K[Kless ~/.bashrc
192[?1049h[?1h=
193# ~/.bashrc: executed by bash(1) for non-login shells.
194# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
195# for examples
196
197# If not running interactively, don't do anything
198[ -z "$PS1" ] && return
199
200# don't put duplicate lines in the history. See bash(1) for more options
201# don't overwrite GNU Midnight Commander's setting of `ignorespace'.
202HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
203# ... or force ignoredups and ignorespace
204HISTCONTROL=ignoreboth
205
206# append to the history file, don't overwrite it
207shopt -s histappend
208
209# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
210
211# check the window size after each command and, if necessary,
212# update the values of LINES and COLUMNS.
213shopt -s checkwinsize
214
215# make less more friendly for non-text input files, see lesspipe(1)
216[7m/home/netfpga/.bashrc [27m[K
217[K[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
218
219# set variable identifying the chroot you work in (used in the prompt below)
220if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
221 debian_chroot=$(cat /etc/debian_chroot)
222fi
223
224# set a fancy prompt (non-color, unless we know we "want" color)
225case "$TERM" in
226 xterm-color) color_prompt=yes;;
227esac
228
229# uncomment for a colored prompt, if the terminal has the capability; turned
230# off by default to not distract the user: the focus in a terminal window
231# should be on the output of commands, not on the prompt
232#force_color_prompt=yes
233
234if [ -n "$force_color_prompt" ]; then
235 if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
236 # We have color support; assume it's compliant with Ecma-48
237 # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
238 # a case would tend to support setf rather than setaf.)
239 color_prompt=yes
240:[K
241[K else
242 color_prompt=
243 fi
244fi
245
246if [ "$color_prompt" = yes ]; then
247 PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\0333[01;34m\]\w\[\033[00m\]\$ '
248else
249 PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
250fi
251unset color_prompt force_color_prompt
252
253# If this is an xterm set the title to user@host:dir
254case "$TERM" in
255xterm*|rxvt*)
256 PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
257 ;;
258*)
259 ;;
260esac
261
262# enable color support of ls and also add handy aliases
263:[K
264[Kif [ -x /usr/bin/dircolors ]; then
265 test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircollors -b)"
266 alias ls='ls --color=auto'
267 #alias dir='dir --color=auto'
268 #alias vdir='vdir --color=auto'
269
270 alias grep='grep --color=auto'
271 alias fgrep='fgrep --color=auto'
272 alias egrep='egrep --color=auto'
273fi
274
275# some more ls aliases
276#alias ll='ls -l'
277#alias la='ls -A'
278#alias l='ls -CF'
279
280# Alias definitions.
281# You may want to put all your additions into a separate file like
282# ~/.bash_aliases, instead of adding them here directly.
283# See /usr/share/doc/bash-doc/examples in the bash-doc package.
284
285if [ -f ~/.bash_aliases ]; then
286:[K
287[K . ~/.bash_aliases
288fi
289
290# enable programmable completion features (you don't need to enable
291# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
292# sources /etc/bash.bashrc).
293if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
294 . /etc/bash_completion
295fi
296[7m(END) [27m[K
297[K
298[K[7m(END) [27m[K
299[K [KESCESC[KOO[KAA
300[K[HM alias fgrep='fgrep --color=auto'
301[24;1H
302[K:[K
303[K [KESCESC[KOO[KBB
304[Kfi
305[7m(END) [27m[K
306[K [KESCESC[KOO[KAA
307[K[HM alias fgrep='fgrep --color=auto'
308[24;1H
309[K:[K
310[K [KESCESC[KOO[KAA
311[K[HM alias grep='grep --color=auto'
312[24;1H
313[K:[K
314[K [KESCESC[KOO[KAA
315[K[HM
316[24;1H
317[K:[K
318[K [KESCESC[KOO[KAA
319[K[HM #alias vdir='vdir --color=auto'
320[24;1H
321[K:[K
322[K [KESCESC[KOO[KAA
323[K[HM #alias dir='dir --color=auto'
324[24;1H
325[K:[K
326[K [KESCESC[KOO[KAA
327[K[HM alias ls='ls --color=auto'
328[24;1H
329[K:[K
330[K [KESCESC[KOO[KAA
331[K[HMlors -b)"
332[24;1H
333[K:[K
334[K [KESCESC[KOO[KAA
335[K[HM test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircol[24;1H
336[K:[K
337[K [KESCESC[KOO[KAA
338[K[HMif [ -x /usr/bin/dircolors ]; then
339[24;1H
340[K:[K
341[K [KESCESC[KOO[KAA
342[K[HM# enable color support of ls and also add handy aliases
343[24;1H
344[K:[K
345[K [KESCESC[KOO[KAA
346[K[HM
347[24;1H
348[K:[K
349[K [KESCESC[KOO[KAA
350[K[HMesac
351[24;1H
352[K:[K
353[K [KESCESC[KOO[KAA
354[K[HM ;;
355[24;1H
356[K:[K
357[K [KESCESC[KOO[KAA
358[K[HM*)
359[24;1H
360[K:[K
361[K [KESCESC[KOO[KAA
362[K[HM ;;
363[24;1H
364[K:[K
365[K [KESCESC[KOO[KAA
366[K[HM PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
367[24;1H
368[K:[K
369[K [KESCESC[KOO[KAA
370[K[HMxterm*|rxvt*)
371[24;1H
372[K:[K
373[K [KESCESC[KOO[KAA
374[K[HMcase "$TERM" in
375[24;1H
376[K:[K
377[K [KESCESC[KOO[KAA
378[K[HM# If this is an xterm set the title to user@host:dir
379[24;1H
380[K:[K
381[K [KESCESC[KOO[KAA
382[K[HM
383[24;1H
384[K:[K
385[K [KESCESC[KOO[KAA
386[K[HMunset color_prompt force_color_prompt
387[24;1H
388[K:[K
389[K [KESCESC[KOO[KAA
390[K[HMfi
391[24;1H
392[K:[K
393[K [KESCESC[KOO[KAA
394[K[HM PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
395[24;1H
396[K:[K
397[K [KESCESC[KOO[KAA
398[K[HMelse
399[24;1H
400[K:[K
401[K [KESCESC[KOO[KAA
402[K[HM33[01;34m\]\w\[\033[00m\]\$ '
403[24;1H
404[K:[K
405[K [KESCESC[KOO[KAA
406[K[HM PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\03[24;1H
407[K:[K
408[K [KESCESC[KOO[KAA
409[K[HMif [ "$color_prompt" = yes ]; then
410[24;1H
411[K:[K
412[K [KESCESC[KOO[KAA
413[K[HM
414[24;1H
415[K:[K
416[K [KESCESC[KOO[KAA
417[K[HMfi
418[24;1H
419[K:[K
420[K [KESCESC[KOO[KAA
421[K[HM fi
422[24;1H
423[K:[K
424[K [KESCESC[KOO[KAA
425[K[HM color_prompt=
426[24;1H
427[K:[K
428[K [KESCESC[KOO[KAA
429[K[HM else
430[24;1H
431[K:[K
432[K [KESCESC[KOO[KAA
433[K[HM color_prompt=yes
434[24;1H
435[K:[K
436[K [KESCESC[KOO[KAA
437[K[HM # a case would tend to support setf rather than setaf.)
438[24;1H
439[K:[K
440[K [KESCESC[KOO[KAA
441[K[HM # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
442[24;1H
443[K:[K
444[K [KESCESC[KOO[KAA
445[K[HM # We have color support; assume it's compliant with Ecma-48
446[24;1H
447[K:[K
448[K [KESCESC[KOO[KAA
449[K[HM if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
450[24;1H
451[K:[K
452[K [KESCESC[KOO[KAA
453[K[HMif [ -n "$force_color_prompt" ]; then
454[24;1H
455[K:[K
456[K [KESCESC[KOO[KAA
457[K[HM
458[24;1H
459[K:[K
460[K [KESCESC[KOO[KAA
461[K[HM#force_color_prompt=yes
462[24;1H
463[K:[K
464[K [KESCESC[KOO[KAA
465[K[HM# should be on the output of commands, not on the prompt
466[24;1H
467[K:[K
468[K [KESCESC[KOO[KAA
469[K[HM# off by default to not distract the user: the focus in a terminal window
470[24;1H
471[K:[K
472[K [KESCESC[KOO[KAA
473[K[HM# uncomment for a colored prompt, if the terminal has the capability; turned
474[24;1H
475[K:[K
476[K [KESCESC[KOO[KAA
477[K[HM
478[24;1H
479[K:[K
480[K [KESCESC[KOO[KAA
481[K[HMesac
482[24;1H
483[K:[K
484[K [KESCESC[KOO[KAA
485[K[HM xterm-color) color_prompt=yes;;
486[24;1H
487[K:[K
488[K [KESCESC[KOO[KAA
489[K[HMcase "$TERM" in
490[24;1H
491[K:[K
492[K [KESCESC[KOO[KAA
493[K[HM# set a fancy prompt (non-color, unless we know we "want" color)
494[24;1H
495[K:[K
496[K [KESCESC[KOO[KAA
497[K[HM
498[24;1H
499[K:[K
500[K [KESCESC[KOO[KAA
501[K[HMfi
502[24;1H
503[K:[K
504[K [KESCESC[KOO[KAA
505[K[HM debian_chroot=$(cat /etc/debian_chroot)
506[24;1H
507[K:[K
508[K [KESCESC[KOO[KAA
509[K[HMif [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
510[24;1H
511[K:[K
512[K [KESCESC[KOO[KAA
513[K[HM# set variable identifying the chroot you work in (used in the prompt below)
514[24;1H
515[K:[K
516[K [KESCESC[KOO[KAA
517[K[HM
518[24;1H
519[K:[K
520[K [KESCESC[KOO[KAA
521[K[HM[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
522[24;1H
523[K:[K
524[K [KESCESC[KOO[KAA
525[K[HM# make less more friendly for non-text input files, see lesspipe(1)
526[24;1H
527[K:[K
528[K [KESCESC[KOO[KAA
529[K[HM
530[24;1H
531[K:[K
532[K [KESCESC[KOO[KAA
533[K[HMshopt -s checkwinsize
534[24;1H
535[K:[K
536[K [KESCESC[KOO[KAA
537[K[HM# update the values of LINES and COLUMNS.
538[24;1H
539[K:[K
540[K [KESCESC[KOO[KAA
541[K[HM# check the window size after each command and, if necessary,
542[24;1H
543[K:[K
544[K [KESCESC[KOO[KAA
545[K[HM
546[24;1H
547[K:[K
548[K [KESCESC[KOO[KAA
549[K[HM# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
550[24;1H
551[K:[K
552[K [KESCESC[KOO[KAA
553[K[HM
554[24;1H
555[K:[K
556[K [KESCESC[KOO[KAA
557[K[HMshopt -s histappend
558[24;1H
559[K:[K
560[K [KESCESC[KOO[KAA
561[K[HM# append to the history file, don't overwrite it
562[24;1H
563[K:[K
564[K [KESCESC[KOO[KAA
565[K[HM
566[24;1H
567[K:[K
568[K [KESCESC[KOO[KAA
569[K[HMHISTCONTROL=ignoreboth
570[24;1H
571[K:[K
572[K [KESCESC[KOO[KAA
573[K[HM# ... or force ignoredups and ignorespace
574[24;1H
575[K:[K
576[K [KESCESC[KOO[KAA
577[K[HMHISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
578[24;1H
579[K:[K
580[K [KESCESC[KOO[KAA
581[K[HM# don't overwrite GNU Midnight Commander's setting of `ignorespace'.
582[24;1H
583[K:[K
584[K [KESCESC[KOO[KAA
585[K[HM# don't put duplicate lines in the history. See bash(1) for more options
586[24;1H
587[K:[K
588[K [KESCESC[KOO[KAA
589[K[HM
590[24;1H
591[K:[K
592[K [KESCESC[KOO[KAA
593[K[HM[ -z "$PS1" ] && return
594[24;1H
595[K:[K
596[K [KESCESC[KOO[KAA
597[K[HM# If not running interactively, don't do anything
598[24;1H
599[K:[K
600[K [KESCESC[KOO[KAA
601[K[HM
602[24;1H
603[K:[K
604[K [KESCESC[KOO[KAA
605[K[HM# for examples
606[24;1H
607[K:[K
608[K [KESCESC[KOO[KAA
609[K[HM# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
610[24;1H
611[K:[K
612[K [KESCESC[KOO[KAA
613[K[HM# ~/.bashrc: executed by bash(1) for non-login shells.
614[24;1H
615[K:[K
616[K [KESCESC[KOO[KAA
617[K
618[K:[K
619[K [KESCESC[KOO[KAA
620[K
621[K:[K
622[K [KESCESC[KOO[KAA
623[K
624[K:[K
625[K [KESCESC[KOO[KAA
626[K
627[K:[K
628[K [KESCESC[KOO[KAA
629[K
630[K:[K
631[K [KESCESC[KOO[KAA
632[K
633[K:[K
634[K [KESCESC[KOO[KAA
635[K
636[K:[K
637[K [KESCESC[KOO[KAA
638[K
639[K:[K
640[K [KESCESC[KOO[KAA
641[K
642[K:[K
643[K [KESCESC[KOO[KAA
644[K
645[K:[K
646[K [KESCESC[KOO[KAA
647[K
648[K:[K
649[K [KESCESC[KOO[KAA
650[K
651[K:[K
652[K [KESCESC[KOO[KAA
653[K
654[K:[K
655[K [KESCESC[KOO[KAA
656[K
657[K:[K
658[K [KESCESC[KOO[KAA
659[K
660[K:[K
661[K [KESCESC[KOO[KAA
662[K
663[K:[K
664[K [KESCESC[KOO[KAA
665[K
666[K:[K
667[K [KESCESC[KOO[KAA
668[K
669[K:[K
670[K [KESCESC[KOO[KAA
671[K
672[K:[K
673[K [KESCESC[KOO[KAA
674[K
675[K:[K
676[K [KESCESC[KOO[KAA
677[K
678[K:[K
679[K [KESCESC[KOO[KAA
680[K
681[K:[K
682[K[?1l>[?1049l]0;netfpga@node1-1: ~netfpga@node1-1:~$ ls netfpga/bashrc_addon [C[1@e[C[1@s
683[?1049h[?1h=
684
685if [ "$NF_ROOT" == "" ]; then
686 export NF_ROOT=${HOME}/netfpga
687fi
688
689if [ "$NF_DESIGN_DIR" == "" ]; then
690 export NF_DESIGN_DIR=${NF_ROOT}/projects/reference_nic
691fi
692
693if [ "$NF_WORK_DIR" == "" ]; then
694 export NF_WORK_DIR=/tmp/${USER}
695fi
696
697export PYTHONPATH=${PYTHONPATH}:${NF_ROOT}/lib/python
698export LD_LIBRARY_PATH=${NF_ROOT}/lib/java/NetFPGAFrontEnd/bin:${LD_LIBRARY_PATH}}
699
700if [ ! -d ${NF_WORK_DIR} ]; then
701 mkdir ${NF_WORK_DIR}
702fi
703
704if [ ! -d ${HOME}/.qt ]; then
705 mkdir ${HOME}/.qt
706[7mnetfpga/bashrc_addon [27m[K
707[Kfi
708:[K
709[K
710:[K
711[Kif [ -f ${NF_ROOT}/bin/nf_profile ]; then
712:[K
713[K source ${NF_ROOT}/bin/nf_profile
714:[K
715[Kfi
716[7m(END) [27m[K
717[K
718[K[7m(END) [27m[K
719[K
720[K[7m(END) [27m[K
721[K
722[K[7m(END) [27m[K
723[K
724[K[7m(END) [27m[K
725[K
726[K[7m(END) [27m[K
727[K
728[K[7m(END) [27m[K
729[K
730[K[7m(END) [27m[K
731[K
732[K[7m(END) [27m[K
733[K
734[K[7m(END) [27m[K
735[K
736[K[7m(END) [27m[K
737[K
738[K[7m(END) [27m[K
739[K
740[K[7m(END) [27m[K
741[K
742[K[7m(END) [27m[K
743[K
744[K[7m(END) [27m[K
745[K
746[K[7m(END) [27m[K
747[K
748[K[7m(END) [27m[K
749[K[?1l>[?1049l]0;netfpga@node1-1: ~netfpga@node1-1:~$ cp bet[K[K[Knetfpga/bashrc_addon /usr/local/netfpga/
750cp: cannot create regular file `/usr/local/netfpga/bashrc_addon': Permission denied
751]0;netfpga@node1-1: ~netfpga@node1-1:~$ cp netfpga/bashrc_addon /usr/local/netfpga/[1@s[1@u[1@d[1@o[1@
752]0;netfpga@node1-1: ~netfpga@node1-1:~$ sudo cp netfpga/bashrc_addon /usr/local/netfpga/
753[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[5P[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C
754[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[17Pless netfpga/bashrc_addon [12P~/.bashrcnetfpga/lib/scripts/user_account_setup/user_account_setup.pl
755[A
756NetFPGA directory already exists copy has been canceled
757Adding the NetFPGA Enviornment Variables to your .bashrc
758]0;netfpga@node1-1: ~netfpga@node1-1:~$ less [K[K[K[K[Knetfpga/lib/scripts/user_account_setup/user_account_setup.pl
759[A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[13Psudo cp netfpga/bashrc_addon /usr/local/netfpga/
760
761[K[A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C
762[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[5P[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C
763[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[17Pless netfpga/bashrc_addon
764[?1049h[?1h=
765
766if [ "$NF_ROOT" == "" ]; then
767 export NF_ROOT=${HOME}/netfpga
768fi
769
770if [ "$NF_DESIGN_DIR" == "" ]; then
771 export NF_DESIGN_DIR=${NF_ROOT}/projects/reference_nic
772fi
773
774if [ "$NF_WORK_DIR" == "" ]; then
775 export NF_WORK_DIR=/tmp/${USER}
776fi
777
778export PYTHONPATH=${PYTHONPATH}:${NF_ROOT}/lib/python
779export LD_LIBRARY_PATH=${NF_ROOT}/lib/java/NetFPGAFrontEnd/bin:${LD_LIBRARY_PATH}}
780
781if [ ! -d ${NF_WORK_DIR} ]; then
782 mkdir ${NF_WORK_DIR}
783fi
784
785if [ ! -d ${HOME}/.qt ]; then
786 mkdir ${HOME}/.qt
787[7mnetfpga/bashrc_addon [27m[K
788[K[?1l>[?1049l]0;netfpga@node1-1: ~netfpga@node1-1:~$ less netfpga/bashrc_addon
789[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cnetfpga/lib/scripts/user_account_setup/user_account_setup.pl
790[A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[13Psudo cp netfpga/bashrc_addon /usr/local/netfpga/
791
792[K[A[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C
793[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[5P[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C
794[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[17Pless netfpga/bashrc_addon [12P~/.bashrc
795[?1049h[?1h=
796# ~/.bashrc: executed by bash(1) for non-login shells.
797# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
798# for examples
799
800# If not running interactively, don't do anything
801[ -z "$PS1" ] && return
802
803# don't put duplicate lines in the history. See bash(1) for more options
804# don't overwrite GNU Midnight Commander's setting of `ignorespace'.
805HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
806# ... or force ignoredups and ignorespace
807HISTCONTROL=ignoreboth
808
809# append to the history file, don't overwrite it
810shopt -s histappend
811
812# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
813
814# check the window size after each command and, if necessary,
815# update the values of LINES and COLUMNS.
816shopt -s checkwinsize
817
818# make less more friendly for non-text input files, see lesspipe(1)
819[7m/home/netfpga/.bashrc [27m[K
820[K[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
821
822# set variable identifying the chroot you work in (used in the prompt below)
823if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
824 debian_chroot=$(cat /etc/debian_chroot)
825fi
826
827# set a fancy prompt (non-color, unless we know we "want" color)
828case "$TERM" in
829 xterm-color) color_prompt=yes;;
830esac
831
832# uncomment for a colored prompt, if the terminal has the capability; turned
833# off by default to not distract the user: the focus in a terminal window
834# should be on the output of commands, not on the prompt
835#force_color_prompt=yes
836
837if [ -n "$force_color_prompt" ]; then
838 if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
839 # We have color support; assume it's compliant with Ecma-48
840 # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
841 # a case would tend to support setf rather than setaf.)
842 color_prompt=yes
843:[K
844[K else
845 color_prompt=
846 fi
847fi
848
849if [ "$color_prompt" = yes ]; then
850 PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\0333[01;34m\]\w\[\033[00m\]\$ '
851else
852 PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
853fi
854unset color_prompt force_color_prompt
855
856# If this is an xterm set the title to user@host:dir
857case "$TERM" in
858xterm*|rxvt*)
859 PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
860 ;;
861*)
862 ;;
863esac
864
865# enable color support of ls and also add handy aliases
866:[K
867[Kif [ -x /usr/bin/dircolors ]; then
868 test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircollors -b)"
869 alias ls='ls --color=auto'
870 #alias dir='dir --color=auto'
871 #alias vdir='vdir --color=auto'
872
873 alias grep='grep --color=auto'
874 alias fgrep='fgrep --color=auto'
875 alias egrep='egrep --color=auto'
876fi
877
878# some more ls aliases
879#alias ll='ls -l'
880#alias la='ls -A'
881#alias l='ls -CF'
882
883# Alias definitions.
884# You may want to put all your additions into a separate file like
885# ~/.bash_aliases, instead of adding them here directly.
886# See /usr/share/doc/bash-doc/examples in the bash-doc package.
887
888if [ -f ~/.bash_aliases ]; then
889:[K
890[K . ~/.bash_aliases
891fi
892
893# enable programmable completion features (you don't need to enable
894# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
895# sources /etc/bash.bashrc).
896if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
897 . /etc/bash_completion
898fi
899
900if [ "$NF_ROOT" == "" ]; then
901 export NF_ROOT=${HOME}/netfpga
902fi
903
904if [ "$NF_DESIGN_DIR" == "" ]; then
905 export NF_DESIGN_DIR=${NF_ROOT}/projects/reference_nic
906fi
907
908if [ "$NF_WORK_DIR" == "" ]; then
909 export NF_WORK_DIR=/tmp/${USER}
910fi
911
912export PYTHONPATH=${PYTHONPATH}:${NF_ROOT}/lib/python
913:[K
914[Kexport LD_LIBRARY_PATH=${NF_ROOT}/lib/java/NetFPGAFrontEnd/bin:${LD_LIBRARY_PATH}}
915
916if [ ! -d ${NF_WORK_DIR} ]; then
917 mkdir ${NF_WORK_DIR}
918fi
919
920if [ ! -d ${HOME}/.qt ]; then
921 mkdir ${HOME}/.qt
922fi
923
924if [ -f ${NF_ROOT}/bin/nf_profile ]; then
925 source ${NF_ROOT}/bin/nf_profile
926fi
927[7m(END) [27m[K
928[K
929[K[7m(END) [27m[K
930[K[?1l>[?1049l]0;netfpga@node1-1: ~netfpga@node1-1:~$ exit
931logout
932Connection to node1-1 closed.
933
934nkiran@console:~$ ssh netfpga@1
935netfpga@node1-1's password:
936Last login: Fri Mar 11 17:17:04 2011 from consolec.sb9.orbit-lab.org
937
938]0;netfpga@node1-1: ~netfpga@node1-1:~$ ls
939[0m[01;34mnetfpga[0m [01;34mpkgs[0m
940[m]0;netfpga@node1-1: ~netfpga@node1-1:~$ echo $PERL5LIB
941/home/netfpga/netfpga/projects/reference_nic/lib/Perl5:/home/netfpga/netfpga/lib/Perl5:
942]0;netfpga@node1-1: ~netfpga@node1-1:~$ netfpga/bin/nf_regress_test.pl
943
944NetFPGA environment:
945 Root dir: /home/netfpga/netfpga
946 Project name: reference_nic
947 Project dir: /home/netfpga/netfpga/projects/reference_nic
948 Work dir: /tmp/netfpga
949
950Root directory is /home/netfpga/netfpga
951
952nf_regress_test.pl: Cannot locate project 'rcp_router'
953]0;netfpga@node1-1: ~netfpga@node1-1:~$ ls netfpga/projects/
954[0m[01;34mcpci[0m [01;34mgeneric_reg_with_instances_test[0m [01;34mrouter_buffer_sizing[0m
955[01;34mcpci_reprogrammer[0m [01;34mgui_scone[0m [01;34mrouter_kit[0m
956[01;34mcrypto_nic[0m Makefile [01;34mscone[0m
957[01;34mddr2_blk_rdwr_test[0m [01;34mreference_nic[0m [01;34mselftest[0m
958[01;34mdram_queue_test[0m [01;34mreference_router[0m [01;34mtutorial_router[0m
959[01;34mdram_router[0m [01;34mreference_switch[0m [01;34mwireshark_dissectors[0m
960[01;34mdriver[0m regress.txt
961[m]0;netfpga@node1-1: ~netfpga@node1-1:~$ ls netfpga/projects/netfpga/bin/nf_regress_test.pl [1@l[1@e[1@s[1@s[1@
962[?1049h[?1h=
963#!/usr/bin/perl -w
964
965use NF::Base;
966use NF::RegAccess;
967use Test::RegressTest;
968
969# check vars are set.
970check_NF2_vars_set();
971
972sub INT_Handler {
973 my $signame = shift;
974 nf_regwrite( 'nf2c0', MDIO_0_CONTROL_REG(), 0x8000 );
975 nf_regwrite( 'nf2c0', MDIO_1_CONTROL_REG(), 0x8000 );
976 nf_regwrite( 'nf2c0', MDIO_2_CONTROL_REG(), 0x8000 );
977 nf_regwrite( 'nf2c0', MDIO_3_CONTROL_REG(), 0x8000 );
978
979 print "\nResetting interfaces...\n";
980 sleep 5;
981 print "\nExited with SIG$signame\n";
982 exit(1);
983}
984
985push @ARGV, "--root=$ENV{'NF_ROOT'}";
986[7mnetfpga/bin/nf_regress_test.pl [27m[K
987[K [KESCESC[KOO[KBB
988[K
989:[K
990[K [KESCESC[KOO[KBB
991[Krun_regress_test( \&INT_Handler, @ARGV );
992[7m(END) [27m[K
993[K [KESCESC[KOO[KBB
994[K
995[K[7m(END) [27m[K
996[K [KESCESC[KOO[KBB
997[K
998[K[7m(END) [27m[K
999[K [KESCESC[KOO[KBB
1000[K
1001[K[7m(END) [27m[K
1002[K [KESCESC[KOO[KBB
1003[K
1004[K[7m(END) [27m[K
1005[K
1006[K[7m(END) [27m[K
1007[K [KESCESC[KOO[KAA
1008[K[HM
1009[24;1H
1010[K:[K
1011[K [KESCESC[KOO[KAA
1012[K[HM#!/usr/bin/perl -w
1013[24;1H
1014[K:[K
1015[K [KESCESC[KOO[KAA
1016[K
1017[K:[K
1018[K [KESCESC[KOO[KAA
1019[K
1020[K:[K
1021[K [KESCESC[KOO[KAA
1022[K
1023[K:[K
1024[K [KESCESC[KOO[KAA
1025[K
1026[K:[K
1027[K [KESCESC[KOO[KAA
1028[K
1029[K:[K
1030[K [KESCESC[KOO[KAA
1031[K
1032[K:[K
1033[K [KESCESC[KOO[KAA
1034[K
1035[K:[K
1036[K [KESCESC[KOO[KAA
1037[K
1038[K:[K
1039[K [KESCESC[KOO[KAA
1040[K
1041[K:[K
1042[K [KESCESC[KOO[KAA
1043[K
1044[K:[K
1045[K [KESCESC[KOO[KAA
1046[K
1047[K:[K
1048[K [KESCESC[KOO[KAA
1049[K
1050[K:[K
1051[K [KESCESC[KOO[KAA
1052[K
1053[K:[K
1054[K [KESCESC[KOO[KAA
1055[K
1056[K:[K
1057[K [KESCESC[KOO[KAA
1058[K
1059[K:[K
1060[K [KESCESC[KOO[KBB
1061[K
1062:[K
1063[K [KESCESC[KOO[KBB
1064[Krun_regress_test( \&INT_Handler, @ARGV );
1065[7m(END) [27m[K
1066[K [KESCESC[KOO[KBB
1067[K
1068[K[7m(END) [27m[K
1069[K [KESCESC[KOO[KBB
1070[K
1071[K[7m(END) [27m[K
1072[K [KESCESC[KOO[KBB
1073[K
1074[K[7m(END) [27m[K
1075[K [KESCESC[KOO[KBB
1076[K
1077[K[7m(END) [27m[K
1078[K [KESCESC[KOO[KBB
1079[K
1080[K[7m(END) [27m[K
1081[K [KESCESC[KOO[KBB
1082[K
1083[K[7m(END) [27m[K
1084[K [KESCESC[KOO[KBB
1085[K
1086[K[7m(END) [27m[K
1087[K [KESCESC[KOO[KBB
1088[K
1089[K[7m(END) [27m[K
1090[K [KESCESC[KOO[KBB
1091[K
1092[K[7m(END) [27m[K
1093[K [KESCESC[KOO[KAA
1094[K[HM
1095[24;1H
1096[K:[K
1097[K [KESCESC[KOO[KAA
1098[K[HM#!/usr/bin/perl -w
1099[24;1H
1100[K:[K
1101[K [KESCESC[KOO[KAA
1102[K
1103[K:[K
1104[K [KESCESC[KOO[KAA
1105[K
1106[K:[K
1107[K [KESCESC[KOO[KAA
1108[K
1109[K:[K
1110[K [KESCESC[KOO[KAA
1111[K
1112[K:[K
1113[K [KESCESC[KOO[KAA
1114[K
1115[K:[K
1116[K [KESCESC[KOO[KAA
1117[K
1118[K:[K
1119[K [KESCESC[KOO[KAA
1120[K
1121[K:[K
1122[K[?1l>[?1049l]0;netfpga@node1-1: ~netfpga@node1-1:~$ less netfpga/bin/nf_regress_test.pl
1123[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[16Ps netfpga/projects/netfpga/bin/nf_regress_test.pl --project driver
1124
1125NetFPGA environment:
1126 Root dir: /home/netfpga/netfpga
1127 Project name: driver
1128 Project dir: /home/netfpga/netfpga/projects/driver
1129 Work dir: /tmp/netfpga
1130
1131Root directory is /home/netfpga/netfpga
1132Running tests on project 'driver'...
1133 Running global setup... PASS
1134 Running test 'driver_compile'... PASS
1135 Running test 'driver_install'... FAIL
1136Output was:
1137[: 30: Illegal number: !
1138rm: cannot remove `/lib/modules/2.6.31-19-generic/kernel/drivers/nf2.ko': Permission denied
1139make -C /lib/modules/2.6.31-19-generic/build M=/home/netfpga/netfpga/lib/C/kernel LDDINC=/home/netfpga/netfpga/lib/C/kernel/../include modules
1140make[1]: Entering directory `/usr/src/linux-headers-2.6.31-19-generic'
1141 Building modules, stage 2.
1142 MODPOST 1 modules
1143make[1]: Leaving directory `/usr/src/linux-headers-2.6.31-19-generic'
1144install -m 644 nf2.ko /lib/modules/`uname -r`/kernel/drivers/nf2.ko
1145install: cannot remove `/lib/modules/2.6.31-19-generic/kernel/drivers/nf2.ko': Permission denied
1146make: *** [install] Error 1
1147
1148
1149driver_install/run exited with value 1
1150
1151 Running test 'modprobe'... PASS
1152 Running test 'verify_mtu'... PASS
1153 Running test 'verify_4_interfaces'... FAIL
1154Output was:
1155[: 97: Illegal number: !
1156SIOCSIFFLAGS: Permission denied
1157SIOCSIFFLAGS: Permission denied
1158SIOCSIFFLAGS: Permission denied
1159SIOCSIFFLAGS: Permission denied
1160FATAL: Error removing nf2 (/lib/modules/2.6.31-19-generic/kernel/drivers/nf2.ko): Operation not permitted
1161/home/netfpga/netfpga/projects/driver/regress/verify_4_interfaces/run: Error: Unable to remove module 'nf2'
1162
1163
1164verify_4_interfaces/run exited with value 1
1165
1166 Running global teardown... PASS
1167
1168
1169]0;netfpga@node1-1: ~netfpga@node1-1:~$ netfpga/bin/nf_regress_test.pl --project driver[1@s[1@u[1@d[1@o[1@
1170Can't locate NF/Base.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at netfpga/bin/nf_regress_test.pl line 3.
1171BEGIN failed--compilation aborted at netfpga/bin/nf_regress_test.pl line 3.
1172]0;netfpga@node1-1: ~netfpga@node1-1:~$ man sudo
1173[?1049h[?1h=
1174SUDO(8) MAINTENANCE COMMANDS SUDO(8)[m
1175[m
1176[1mNAME[0m[m
1177 sudo, sudoedit - execute a command as another user[m
1178[m
1179[1mSYNOPSIS[0m[m
1180 [1msudo[0m [[1m-n[0m] [1m-h[0m | [1m-K[0m | [1m-k[0m | [1m-L[0m | [1m-V[0m | [1m-v[0m[m
1181[m
1182 [1msudo[0m [1m-l[l][0m [[1m-AnS[0m] [[1m-g[0m [4mgroupname[24m|[4m#gid[24m] [[1m-U[0m [4musername[24m] [[1m-u[0m [4musername[24m|[4m#uid[24m][m
1183 [[4mcommand[24m][m
1184[m
1185 [1msudo[0m [[1m-AbEHnPS[0m] [[1m-a[0m [4mauth_type[24m] [[1m-C[0m [4mfd[24m] [[1m-c[0m [4mclass[24m|[4m-[24m] [[1m-g[0m [4mgroupname[24m|[4m#gid[24m][m
1186 [[1m-p[0m [4mprompt[24m] [[1m-r[0m [4mrole[24m] [[1m-t[0m [4mtype[24m] [[1m-u[0m [4musername[24m|[4m#uid[24m] [[1mVAR[0m=[4mvalue[24m][m
1187 [[1m-i[0m | [1m-s[0m] [[4mcommand[24m][m
1188[m
1189 [1msudoedit[0m [[1m-AnS[0m] [[1m-a[0m [4mauth_type[24m] [[1m-C[0m [4mfd[24m] [[1m-c[0m [4mclass[24m|[4m-[24m] [[1m-g[0m [4mgroupname[24m|[4m#gid[24m][m
1190 [[1m-p[0m [4mprompt[24m] [[1m-u[0m [4musername[24m|[4m#uid[24m] file ...[m
1191[m
1192[1mDESCRIPTION[0m[m
1193 [1msudo[0m allows a permitted user to execute a [4mcommand[24m as the superuser or[m
1194 another user, as specified in the [4msudoers[24m file. The real and effective[m
1195 uid and gid are set to match those of the target user as specified in[m
1196 the passwd file and the group vector is initialized based on the group[m
1197[7m Manual page sudo(8) line 1[27m[K
1198[K [KESCESC[KOO[KBB
1199[K file (unless the [1m-P[0m option was specified). If the invoking user is[m
1200[7m Manual page sudo(8) line 2[27m[K
1201[K [KESCESC[KOO[KBB
1202[K root or if the target user is the same as the invoking user, no[m
1203[7m Manual page sudo(8) line 5[27m[K
1204[K [KESCESC[KOO[KBB
1205[K password is required. Otherwise, [1msudo[0m requires that users authenticate[m
1206[7m Manual page sudo(8) line 6[27m[K
1207[K [KESCESC[KOO[KBB
1208[K themselves with a password by default (NOTE: in the default[m
1209[7m Manual page sudo(8) line 7[27m[K
1210[K [KESCESC[KOO[KBB
1211[K configuration this is the user's password, not the root password).[m
1212[7m Manual page sudo(8) line 8[27m[K
1213[K [KESCESC[KOO[KBB
1214[K Once a user has been authenticated, a timestamp is updated and the user[m
1215[7m Manual page sudo(8) line 9[27m[K
1216[K [KESCESC[KOO[KBB
1217[K may then use sudo without a password for a short period of time (15[m
1218[7m Manual page sudo(8) line 10[27m[K
1219[K [KESCESC[KOO[KBB
1220[K minutes unless overridden in [4msudoers[24m).[m
1221[7m Manual page sudo(8) line 11[27m[K
1222[K [KESCESC[KOO[KBB
1223[K[m
1224[7m Manual page sudo(8) line 12[27m[K
1225[K [KESCESC[KOO[KBB
1226[K When invoked as [1msudoedit[0m, the [1m-e[0m option (described below), is implied.[m
1227[7m Manual page sudo(8) line 13[27m[K
1228[K [KESCESC[KOO[KBB
1229[K[m
1230[7m Manual page sudo(8) line 14[27m[K
1231[K [KESCESC[KOO[KBB
1232[K [1msudo[0m determines who is an authorized user by consulting the file[m
1233[7m Manual page sudo(8) line 15[27m[K
1234[K [KESCESC[KOO[KBB
1235[K [4m@sysconfdir@/sudoers[24m. By running [1msudo[0m with the [1m-v[0m option, a user can[m
1236[7m Manual page sudo(8) line 16[27m[K
1237[K [KESCESC[KOO[KBB
1238[K update the time stamp without running a [4mcommand[24m. The password prompt[m
1239[7m Manual page sudo(8) line 17[27m[K
1240[K [KESCESC[KOO[KBB
1241[K itself will also time out if the user's password is not entered within[m
1242[7m Manual page sudo(8) line 18[27m[K
1243[K [KESCESC[KOO[KBB
1244[K 0 minutes (unless overridden via [4msudoers[24m).[m
1245[7m Manual page sudo(8) line 19[27m[K
1246[K [KESCESC[KOO[KBB
1247[K[m
1248[7m Manual page sudo(8) line 20[27m[K
1249[K [KESCESC[KOO[KBB
1250[K If a user who is not listed in the [4msudoers[24m file tries to run a command[m
1251[7m Manual page sudo(8) line 21[27m[K
1252[K [KESCESC[KOO[KBB
1253[K via [1msudo[0m, mail is sent to the proper authorities, as defined at[m
1254[7m Manual page sudo(8) line 22[27m[K
1255[K [KESCESC[KOO[KBB
1256[K configure time or in the [4msudoers[24m file (defaults to root). Note that[m
1257[7m Manual page sudo(8) line 23[27m[K
1258[K [KESCESC[KOO[KBB
1259[K the mail will not be sent if an unauthorized user tries to run sudo[m
1260[7m Manual page sudo(8) line 24[27m[K
1261[K [KESCESC[KOO[KBB
1262[K with the [1m-l[0m or [1m-v[0m option. This allows users to determine for[m
1263[7m Manual page sudo(8) line 25[27m[K
1264[K [KESCESC[KOO[KBB
1265[K themselves whether or not they are allowed to use [1msudo[0m.[m
1266[7m Manual page sudo(8) line 26[27m[K
1267[K [KESCESC[KOO[KBB
1268[K[m
1269[7m Manual page sudo(8) line 27[27m[K
1270[K [KESCESC[KOO[KBB
1271[K If [1msudo[0m is run by root and the SUDO_USER environment variable is set,[m
1272[7m Manual page sudo(8) line 28[27m[K
1273[K [KESCESC[KOO[KBB
1274[K [1msudo[0m will use this value to determine who the actual user is. This can[m
1275[7m Manual page sudo(8) line 29[27m[K
1276[K [KESCESC[KOO[KBB
1277[K be used by a user to log commands through sudo even when a root shell[m
1278[7m Manual page sudo(8) line 30[27m[K
1279[K [KESCESC[KOO[KBB
1280[K has been invoked. It also allows the [1m-e[0m option to remain useful even[m
1281[7m Manual page sudo(8) line 31[27m[K
1282[K [KESCESC[KOO[KBB
1283[K when being run via a sudo-run script or program. Note however, that[m
1284[7m Manual page sudo(8) line 32[27m[K
1285[K [KESCESC[KOO[KBB
1286[K the sudoers lookup is still done for root, not the user specified by[m
1287[7m Manual page sudo(8) line 33[27m[K
1288[K [KESCESC[KOO[KBB
1289[K SUDO_USER.[m
1290[7m Manual page sudo(8) line 34[27m[K
1291[K [KESCESC[KOO[KBB
1292[K[m
1293[7m Manual page sudo(8) line 35[27m[K
1294[K [KESCESC[KOO[KBB
1295[K [1msudo[0m can log both successful and unsuccessful attempts (as well as[m
1296[7m Manual page sudo(8) line 36[27m[K
1297[K [KESCESC[KOO[KBB
1298[K errors) to [4msyslog[24m(3), a log file, or both. By default [1msudo[0m will log[m
1299[7m Manual page sudo(8) line 37[27m[K
1300[K [KESCESC[KOO[KBB
1301[K via [4msyslog[24m(3) but this is changeable at configure time or via the[m
1302[7m Manual page sudo(8) line 38[27m[K
1303[K [KESCESC[KOO[KBB
1304[K [4msudoers[24m file.[m
1305[7m Manual page sudo(8) line 39[27m[K
1306[K [KESCESC[KOO[KBB
1307[K[m
1308[7m Manual page sudo(8) line 40[27m[K
1309[K [KESCESC[KOO[KBB
1310[K[1mOPTIONS[0m[m
1311[7m Manual page sudo(8) line 41[27m[K
1312[K [KESCESC[KOO[KBB
1313[K [1msudo[0m accepts the following command line options:[m
1314[7m Manual page sudo(8) line 42[27m[K
1315[K [KESCESC[KOO[KBB
1316[K[m
1317[7m Manual page sudo(8) line 43[27m[K
1318[K [KESCESC[KOO[KBB
1319[K -A Normally, if [1msudo[0m requires a password, it will read it from[m
1320[7m Manual page sudo(8) line 44[27m[K
1321[K [KESCESC[KOO[KBB
1322[K the current terminal. If the [1m-A[0m ([4maskpass[24m) option is[m
1323[7m Manual page sudo(8) line 45[27m[K
1324[K [KESCESC[KOO[KBB
1325[K specified, a helper program is executed to read the user's[m
1326[7m Manual page sudo(8) line 46[27m[K
1327[K [KESCESC[KOO[KBB
1328[K password and output the password to the standard output.[m
1329[7m Manual page sudo(8) line 47[27m[K
1330[K [KESCESC[KOO[KBB
1331[K If the SUDO_ASKPASS environment variable is set, it[m
1332[7m Manual page sudo(8) line 48[27m[K
1333[K [KESCESC[KOO[KBB
1334[K specifies the path to the helper program. Otherwise, the[m
1335[7m Manual page sudo(8) line 49[27m[K
1336[K [KESCESC[KOO[KBB
1337[K value specified by the [4maskpass[24m option in [4msudoers[24m(5) is[m
1338[7m Manual page sudo(8) line 50[27m[K
1339[K [KESCESC[KOO[KBB
1340[K used.[m
1341[7m Manual page sudo(8) line 51[27m[K
1342[K [KESCESC[KOO[KBB
1343[K[m
1344[7m Manual page sudo(8) line 52[27m[K
1345[K [KESCESC[KOO[KBB
1346[K -a [4mtype[24m The [1m-a[0m ([4mauthentication[24m [4mtype[24m) option causes [1msudo[0m to use the[m
1347[7m Manual page sudo(8) line 53[27m[K
1348[K [KESCESC[KOO[KBB
1349[K specified authentication type when validating the user, as[m
1350[7m Manual page sudo(8) line 54[27m[K
1351[K [KESCESC[KOO[KBB
1352[K allowed by [4m/etc/login.conf[24m. The system administrator may[m
1353[7m Manual page sudo(8) line 55[27m[K
1354[K [KESCESC[KOO[KBB
1355[K specify a list of sudo-specific authentication methods by[m
1356[7m Manual page sudo(8) line 56[27m[K
1357[K [KESCESC[KOO[KBB
1358[K adding an "auth-sudo" entry in [4m/etc/login.conf[24m. This[m
1359[7m Manual page sudo(8) line 57[27m[K
1360[K [KESCESC[KOO[KBB
1361[K option is only available on systems that support BSD[m
1362[7m Manual page sudo(8) line 58[27m[K
1363[K [KESCESC[KOO[KBB
1364[K authentication.[m
1365[7m Manual page sudo(8) line 59[27m[K
1366[K [KESCESC[KOO[KBB
1367[K[m
1368[7m Manual page sudo(8) line 60[27m[K
1369[K [KESCESC[KOO[KBB
1370[K -b The [1m-b[0m ([4mbackground[24m) option tells [1msudo[0m to run the given[m
1371[7m Manual page sudo(8) line 61[27m[K
1372[K [KESCESC[KOO[KBB
1373[K command in the background. Note that if you use the [1m-b[0m[m
1374[7m Manual page sudo(8) line 62[27m[K
1375[K [KESCESC[KOO[KBB
1376[K option you cannot use shell job control to manipulate the[m
1377[7m Manual page sudo(8) line 63[27m[K
1378[K [KESCESC[KOO[KBB
1379[K process.[m
1380[7m Manual page sudo(8) line 64[27m[K
1381[K [KESCESC[KOO[KBB
1382[K[m
1383[7m Manual page sudo(8) line 65[27m[K
1384[K [KESCESC[KOO[KBB
1385[K -C [4mfd[24m Normally, [1msudo[0m will close all open file descriptors other[m
1386[7m Manual page sudo(8) line 66[27m[K
1387[K [KESCESC[KOO[KBB
1388[K than standard input, standard output and standard error.[m
1389[7m Manual page sudo(8) line 67[27m[K
1390[K [KESCESC[KOO[KBB
1391[K The [1m-C[0m ([4mclose[24m [4mfrom[24m) option allows the user to specify a[m
1392[7m Manual page sudo(8) line 68[27m[K
1393[K [KESCESC[KOO[KBB
1394[K starting point above the standard error (file descriptor[m
1395[7m Manual page sudo(8) line 69[27m[K
1396[K [KESCESC[KOO[KBB
1397[K three). Values less than three are not permitted. This[m
1398[7m Manual page sudo(8) line 70[27m[K
1399[K [KESCESC[KOO[KBB
1400[K option is only available if the administrator has enabled[m
1401[7m Manual page sudo(8) line 71[27m[K
1402[K [KESCESC[KOO[KBB
1403[K the [4mclosefrom_override[24m option in [4msudoers[24m(5).[m
1404[7m Manual page sudo(8) line 72[27m[K
1405[K [KESCESC[KOO[KBB
1406[K[m
1407[7m Manual page sudo(8) line 73[27m[K
1408[K [KESCESC[KOO[KBB
1409[K -c [4mclass[24m The [1m-c[0m ([4mclass[24m) option causes [1msudo[0m to run the specified[m
1410[7m Manual page sudo(8) line 74[27m[K
1411[K [KESCESC[KOO[KBB
1412[K command with resources limited by the specified login[m
1413[7m Manual page sudo(8) line 75[27m[K
1414[K [KESCESC[KOO[KBB
1415[K class. The [4mclass[24m argument can be either a class name as[m
1416[7m Manual page sudo(8) line 76[27m[K
1417[K [KESCESC[KOO[KBB
1418[K defined in [4m/etc/login.conf[24m, or a single '-' character.[m
1419[7m Manual page sudo(8) line 77[27m[K
1420[K [KESCESC[KOO[KBB
1421[K Specifying a [4mclass[24m of - indicates that the command should[m
1422[7m Manual page sudo(8) line 78[27m[K
1423[K [KESCESC[KOO[KBB
1424[K be run restricted by the default login capabilities for the[m
1425[7m Manual page sudo(8) line 79[27m[K
1426[K [KESCESC[KOO[KBB
1427[K user the command is run as. If the [4mclass[24m argument[m
1428[7m Manual page sudo(8) line 80[27m[K
1429[K [KESCESC[KOO[KBB
1430[K specifies an existing user class, the command must be run[m
1431[7m Manual page sudo(8) line 81[27m[K
1432[K [KESCESC[KOO[KBB
1433[K as root, or the [1msudo[0m command must be run from a shell that[m
1434[7m Manual page sudo(8) line 82[27m[K
1435[K [KESCESC[KOO[KBB
1436[K is already root. This option is only available on systems[m
1437[7m Manual page sudo(8) line 83[27m[K
1438[K [KESCESC[KOO[KBB
1439[K with BSD login classes.[m
1440[7m Manual page sudo(8) line 84[27m[K
1441[K [KESCESC[KOO[KBB
1442[K[m
1443[7m Manual page sudo(8) line 85[27m[K
1444[K [KESCESC[KOO[KBB
1445[K -E The [1m-E[0m ([4mpreserve[24m [4menvironment[24m) option will override the[m
1446[7m Manual page sudo(8) line 86[27m[K
1447[K [KESCESC[KOO[KBB
1448[K [4menv_reset[24m option in [4msudoers[24m(5)). It is only available when[m
1449[7m Manual page sudo(8) line 87[27m[K
1450[K [KESCESC[KOO[KBB
1451[K either the matching command has the SETENV tag or the[m
1452[7m Manual page sudo(8) line 88[27m[K
1453[K [KESCESC[KOO[KBB
1454[K [4msetenv[24m option is set in [4msudoers[24m(5).[m
1455[7m Manual page sudo(8) line 89[27m[K
1456[K [KESCESC[KOO[KBB
1457[K[m
1458[7m Manual page sudo(8) line 90[27m[K
1459[K [KESCESC[KOO[KBB
1460[K -e The [1m-e[0m ([4medit[24m) option indicates that, instead of running a[m
1461[7m Manual page sudo(8) line 91[27m[K
1462[K [KESCESC[KOO[KBB
1463[K command, the user wishes to edit one or more files. In[m
1464[7m Manual page sudo(8) line 92[27m[K
1465[K [KESCESC[KOO[KBB
1466[K lieu of a command, the string "sudoedit" is used when[m
1467[7m Manual page sudo(8) line 93[27m[K
1468[K[?1l>[?1049l]0;netfpga@node1-1: ~netfpga@node1-1:~$ man sudosudo netfpga/bin/nf_regress_test.pl --project driver[C[C[C[C[C[1@-[1@E[1@
1469Can't locate NF/Base.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at netfpga/bin/nf_regress_test.pl line 3.
1470BEGIN failed--compilation aborted at netfpga/bin/nf_regress_test.pl line 3.
1471]0;netfpga@node1-1: ~netfpga@node1-1:~$ set
1472BASH=/bin/bash
1473BASH_ALIASES=()
1474BASH_ARGC=()
1475BASH_ARGV=()
1476BASH_CMDS=()
1477BASH_COMPLETION=/etc/bash_completion
1478BASH_COMPLETION_DIR=/etc/bash_completion.d
1479BASH_LINENO=()
1480BASH_SOURCE=()
1481BASH_VERSINFO=([0]="4" [1]="0" [2]="33" [3]="1" [4]="release" [5]="i486-pc-linux-gnu")
1482BASH_VERSION='4.0.33(1)-release'
1483COLUMNS=80
1484COMP_WORDBREAKS=$' \t\n"\'><=;|&(:'
1485DIRSTACK=()
1486EUID=1001
1487GROUPS=()
1488HISTCONTROL=ignoreboth
1489HISTFILE=/home/netfpga/.bash_history
1490HISTFILESIZE=500
1491HISTSIZE=500
1492HOME=/home/netfpga
1493HOSTNAME=node1-1.sb9.orbit-lab.org
1494HOSTTYPE=i486
1495IFS=$' \t\n'
1496LANG=en_US.UTF-8
1497LD_LIBRARY_PATH=/home/netfpga/netfpga/lib/java/NetFPGAFrontEnd/bin:
1498LESSCLOSE='/usr/bin/lesspipe %s %s'
1499LESSOPEN='| /usr/bin/lesspipe %s'
1500LINES=24
1501LOGNAME=netfpga
1502LS_COLORS='rs=0:di=01;34:ln=01;36:hl=44;37:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:'
1503MACHTYPE=i486-pc-linux-gnu
1504MAIL=/var/mail/netfpga
1505MAILCHECK=60
1506NF_DESIGN_DIR=/home/netfpga/netfpga/projects/reference_nic
1507NF_ROOT=/home/netfpga/netfpga
1508NF_WORK_DIR=/tmp/netfpga
1509OPTERR=1
1510OPTIND=1
1511OSTYPE=linux-gnu
1512PATH=/home/netfpga/netfpga/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
1513PERL5LIB=/home/netfpga/netfpga/projects/reference_nic/lib/Perl5:/home/netfpga/netfpga/lib/Perl5:
1514PIPESTATUS=([0]="2")
1515PPID=13207
1516PS1='\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
1517PS2='> '
1518PS4='+ '
1519PWD=/home/netfpga
1520PYTHONPATH=:/home/netfpga/netfpga/lib/python
1521SHELL=/bin/bash
1522SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
1523SHLVL=1
1524SSH_CLIENT='10.19.0.10 59446 22'
1525SSH_CONNECTION='10.19.0.10 59446 10.19.1.1 22'
1526SSH_TTY=/dev/pts/0
1527TERM=xterm
1528UID=1001
1529USER=netfpga
1530USERLAND=GNU
1531_=driver
1532__git_all_commandlist=$'add\ngrep\nread-tree\nhash-object\nrebase\nam\nhelp\nannotate\nhttp-fetch\nreceive-pack\napply\nhttp-push\nreflog\narchive\nimap-send\nrelink\nbisect\nindex-pack\nremote\ninit\nrepack\nblame\ninit-db\nrepo-config\nbranch\ninstaweb\nrequest-pull\nbundle\nlog\nrerere\ncat-file\nlost-found\nreset\ncheck-attr\nls-files\nrev-list\ncheck-ref-format\nls-remote\nrev-parse\ncheckout\nls-tree\nrevert\ncheckout-index\nmailinfo\nrm\ncherry\nmailsplit\nsend-pack\ncherry-pick\nmerge\nsh-setup\nclean\nmerge-base\nshell\nclone\nmerge-file\nshortlog\ncommit\nmerge-index\nshow\ncommit-tree\nmerge-octopus\nshow-branch\nconfig\nmerge-one-file\nshow-index\ncount-objects\nmerge-ours\nshow-ref\ndaemon\nmerge-recursive\nstage\ndescribe\nmerge-resolve\nstash\ndiff\nmerge-subtree\nstatus\ndiff-files\nmerge-tree\nstripspace\ndiff-index\nmergetool\nsubmodule\ndiff-tree\nsymbolic-ref\ndifftool\nmktag\ntag\nmktree\ntar-tree\nfast-export\nmv\nunpack-file\nfast-import\nname-rev\nunpack-objects\nfetch\npack-objects\nupdate-index\npack-redundant\nupdate-ref\nfetch-pack\npack-refs\nupdate-server-info\nfilter-branch\nparse-remote\nupload-archive\nfmt-merge-msg\npatch-id\nupload-pack\nfor-each-ref\npeek-remote\nvar\nformat-patch\nprune\nverify-pack\nfsck\nprune-packed\nverify-tag\nfsck-objects\npull\ngc\npush\nwhatchanged\nget-tar-commit-id\nquiltimport\nwrite-tree'
1533__git_diff_common_options=$'--stat --numstat --shortstat --summary\n\t\t\t--patch-with-stat --name-only --name-status --color\n\t\t\t--no-color --color-words --no-renames --check\n\t\t\t--full-index --binary --abbrev --diff-filter=\n\t\t\t--find-copies-harder\n\t\t\t--text --ignore-space-at-eol --ignore-space-change\n\t\t\t--ignore-all-space --exit-code --quiet --ext-diff\n\t\t\t--no-ext-diff\n\t\t\t--no-prefix --src-prefix= --dst-prefix=\n\t\t\t--inter-hunk-context=\n\t\t\t--patience\n\t\t\t--raw\n'
1534__git_fetch_options=$'\n\t--quiet --verbose --append --upload-pack --force --keep --depth=\n\t--tags --no-tags\n'
1535__git_log_common_options=$'\n\t--not --all\n\t--branches --tags --remotes\n\t--first-parent --no-merges\n\t--max-count=\n\t--max-age= --since= --after=\n\t--min-age= --until= --before=\n'
1536__git_log_date_formats='relative iso8601 rfc2822 short local default raw'
1537__git_log_gitk_options=$'\n\t--dense --sparse --full-history\n\t--simplify-merges --simplify-by-decoration\n\t--left-right\n'
1538__git_log_pretty_formats='oneline short medium full fuller email raw format:'
1539__git_log_shortlog_options=$'\n\t--author= --committer= --grep=\n\t--all-match\n'
1540__git_merge_options=$'\n\t--no-commit --no-stat --log --no-log --squash --strategy\n\t--commit --stat --no-squash --ff --no-ff\n'
1541__git_merge_strategylist=
1542__git_mergetools_common=$'diffuse ecmerge emerge kdiff3 meld opendiff\n\t\t\ttkdiff vimdiff gvimdiff xxdiff\n'
1543__git_porcelain_commandlist=$'help\nadd\ngrep\nrebase\nam\nhelp\nannotate\napply\narchive\nimap-send\nrelink\nbisect\nremote\ninit\nrepack\nblame\nbranch\ninstaweb\nrequest-pull\nbundle\nlog\nreset\ncheckout\nrevert\nrm\ncherry\ncherry-pick\nmerge\nclean\nclone\nshortlog\ncommit\nshow\nshow-branch\nconfig\nstage\ndescribe\nstash\ndiff\nstatus\nmergetool\nsubmodule\ndifftool\ntag\nmv\nname-rev\nfetch\nfilter-branch\nformat-patch\nfsck\npull\ngc\npush\nwhatchanged\nget-tar-commit-id'
1544__git_send_email_confirm_options='always never auto cc compose'
1545__git_send_email_suppresscc_options='author self cc ccbody sob cccmd body all'
1546__git_whitespacelist='nowarn warn error error-all fix'
1547bash205='4.0.33(1)-release'
1548bash205b='4.0.33(1)-release'
1549bash3='4.0.33(1)-release'
1550__git_aliased_command ()
1551{
1552 local word cmdline=$(git --git-dir="$(__gitdir)" config --get "alias.$1");
1553 for word in $cmdline;
1554 do
1555 if [ "${word##-*}" ]; then
1556 echo $word;
1557 return;
1558 fi;
1559 done
1560}
1561__git_aliases ()
1562{
1563 local i IFS='
1564';
1565 for i in $(git --git-dir="$(__gitdir)" config --list);
1566 do
1567 case "$i" in
1568 alias.*)
1569 i="${i#alias.}";
1570 echo "${i/=*/}"
1571 ;;
1572 esac;
1573 done
1574}
1575__git_all_commands ()
1576{
1577 if [ -n "${__git_all_commandlist-}" ]; then
1578 echo "$__git_all_commandlist";
1579 return;
1580 fi;
1581 local i IFS=" "'
1582';
1583 for i in $(git help -a|egrep '^ ');
1584 do
1585 case $i in
1586 *--*)
1587 : helper pattern
1588 ;;
1589 *)
1590 echo $i
1591 ;;
1592 esac;
1593 done
1594}
1595__git_complete_file ()
1596{
1597 local pfx ls ref cur="${COMP_WORDS[COMP_CWORD]}";
1598 case "$cur" in
1599 ?*:*)
1600 ref="${cur%%:*}";
1601 cur="${cur#*:}";
1602 case "$cur" in
1603 ?*/*)
1604 pfx="${cur%/*}";
1605 cur="${cur##*/}";
1606 ls="$ref:$pfx";
1607 pfx="$pfx/"
1608 ;;
1609 *)
1610 ls="$ref"
1611 ;;
1612 esac;
1613 case "$COMP_WORDBREAKS" in
1614 *:*)
1615 : great
1616 ;;
1617 *)
1618 pfx="$ref:$pfx"
1619 ;;
1620 esac;
1621 local IFS='
1622';
1623 COMPREPLY=($(compgen -P "$pfx" -W "$(git --git-dir="$(__gitdir)" ls-tree "$ls" | sed '/^100... blob /{
1624 s,^.* ,,
1625 s,$, ,
1626 }
1627 /^120000 blob /{
1628 s,^.* ,,
1629 s,$, ,
1630 }
1631 /^040000 tree /{
1632 s,^.* ,,
1633 s,$,/,
1634 }
1635 s/^.* //')" -- "$cur"))
1636 ;;
1637 *)
1638 __gitcomp "$(__git_refs)"
1639 ;;
1640 esac
1641}
1642__git_complete_remote_or_refspec ()
1643{
1644 local cmd="${COMP_WORDS[1]}";
1645 local cur="${COMP_WORDS[COMP_CWORD]}";
1646 local i c=2 remote="" pfx="" lhs=1 no_complete_refspec=0;
1647 while [ $c -lt $COMP_CWORD ]; do
1648 i="${COMP_WORDS[c]}";
1649 case "$i" in
1650 --all | --mirror)
1651 [ "$cmd" = "push" ] && no_complete_refspec=1
1652 ;;
1653 -*)
1654
1655 ;;
1656 *)
1657 remote="$i";
1658 break
1659 ;;
1660 esac;
1661 c=$((++c));
1662 done;
1663 if [ -z "$remote" ]; then
1664 __gitcomp "$(__git_remotes)";
1665 return;
1666 fi;
1667 if [ $no_complete_refspec = 1 ]; then
1668 COMPREPLY=();
1669 return;
1670 fi;
1671 [ "$remote" = "." ] && remote=;
1672 case "$cur" in
1673 *:*)
1674 case "$COMP_WORDBREAKS" in
1675 *:*)
1676 : great
1677 ;;
1678 *)
1679 pfx="${cur%%:*}:"
1680 ;;
1681 esac;
1682 cur="${cur#*:}";
1683 lhs=0
1684 ;;
1685 +*)
1686 pfx="+";
1687 cur="${cur#+}"
1688 ;;
1689 esac;
1690 case "$cmd" in
1691 fetch)
1692 if [ $lhs = 1 ]; then
1693 __gitcomp "$(__git_refs2 "$remote")" "$pfx" "$cur";
1694 else
1695 __gitcomp "$(__git_refs)" "$pfx" "$cur";
1696 fi
1697 ;;
1698 pull)
1699 if [ $lhs = 1 ]; then
1700 __gitcomp "$(__git_refs "$remote")" "$pfx" "$cur";
1701 else
1702 __gitcomp "$(__git_refs)" "$pfx" "$cur";
1703 fi
1704 ;;
1705 push)
1706 if [ $lhs = 1 ]; then
1707 __gitcomp "$(__git_refs)" "$pfx" "$cur";
1708 else
1709 __gitcomp "$(__git_refs "$remote")" "$pfx" "$cur";
1710 fi
1711 ;;
1712 esac
1713}
1714__git_complete_revlist ()
1715{
1716 local pfx cur="${COMP_WORDS[COMP_CWORD]}";
1717 case "$cur" in
1718 *...*)
1719 pfx="${cur%...*}...";
1720 cur="${cur#*...}";
1721 __gitcomp "$(__git_refs)" "$pfx" "$cur"
1722 ;;
1723 *..*)
1724 pfx="${cur%..*}..";
1725 cur="${cur#*..}";
1726 __gitcomp "$(__git_refs)" "$pfx" "$cur"
1727 ;;
1728 *)
1729 __gitcomp "$(__git_refs)"
1730 ;;
1731 esac
1732}
1733__git_complete_strategy ()
1734{
1735 case "${COMP_WORDS[COMP_CWORD-1]}" in
1736 -s | --strategy)
1737 __gitcomp "$(__git_merge_strategies)";
1738 return 0
1739 ;;
1740 esac;
1741 local cur="${COMP_WORDS[COMP_CWORD]}";
1742 case "$cur" in
1743 --strategy=*)
1744 __gitcomp "$(__git_merge_strategies)" "" "${cur##--strategy=}";
1745 return 0
1746 ;;
1747 esac;
1748 return 1
1749}
1750__git_find_subcommand ()
1751{
1752 local word subcommand c=1;
1753 while [ $c -lt $COMP_CWORD ]; do
1754 word="${COMP_WORDS[c]}";
1755 for subcommand in $1;
1756 do
1757 if [ "$subcommand" = "$word" ]; then
1758 echo "$subcommand";
1759 return;
1760 fi;
1761 done;
1762 c=$((++c));
1763 done
1764}
1765__git_has_doubledash ()
1766{
1767 local c=1;
1768 while [ $c -lt $COMP_CWORD ]; do
1769 if [ "--" = "${COMP_WORDS[c]}" ]; then
1770 return 0;
1771 fi;
1772 c=$((++c));
1773 done;
1774 return 1
1775}
1776__git_heads ()
1777{
1778 local cmd i is_hash=y dir="$(__gitdir "${1-}")";
1779 if [ -d "$dir" ]; then
1780 git --git-dir="$dir" for-each-ref --format='%(refname:short)' refs/heads;
1781 return;
1782 fi;
1783 for i in $(git ls-remote "${1-}" 2>/dev/null);
1784 do
1785 case "$is_hash,$i" in
1786 y,*)
1787 is_hash=n
1788 ;;
1789 n,*^{})
1790 is_hash=y
1791 ;;
1792 n,refs/heads/*)
1793 is_hash=y;
1794 echo "${i#refs/heads/}"
1795 ;;
1796 n,*)
1797 is_hash=y;
1798 echo "$i"
1799 ;;
1800 esac;
1801 done
1802}
1803__git_merge_strategies ()
1804{
1805 if [ -n "${__git_merge_strategylist-}" ]; then
1806 echo "$__git_merge_strategylist";
1807 return;
1808 fi;
1809 git merge -s help 2>&1 | sed -n -e '/[Aa]vailable strategies are: /,/^$/{
1810 s/\.$//
1811 s/.*://
1812 s/^[ ]*//
1813 s/[ ]*$//
1814 p
1815 }'
1816}
1817__git_porcelain_commands ()
1818{
1819 if [ -n "${__git_porcelain_commandlist-}" ]; then
1820 echo "$__git_porcelain_commandlist";
1821 return;
1822 fi;
1823 local i IFS=" "'
1824';
1825 for i in "help" $(__git_all_commands);
1826 do
1827 case $i in
1828 *--*)
1829 : helper pattern
1830 ;;
1831 applymbox)
1832 : ask gittus
1833 ;;
1834 applypatch)
1835 : ask gittus
1836 ;;
1837 archimport)
1838 : import
1839 ;;
1840 cat-file)
1841 : plumbing
1842 ;;
1843 check-attr)
1844 : plumbing
1845 ;;
1846 check-ref-format)
1847 : plumbing
1848 ;;
1849 checkout-index)
1850 : plumbing
1851 ;;
1852 commit-tree)
1853 : plumbing
1854 ;;
1855 count-objects)
1856 : infrequent
1857 ;;
1858 cvsexportcommit)
1859 : export
1860 ;;
1861 cvsimport)
1862 : import
1863 ;;
1864 cvsserver)
1865 : daemon
1866 ;;
1867 daemon)
1868 : daemon
1869 ;;
1870 diff-files)
1871 : plumbing
1872 ;;
1873 diff-index)
1874 : plumbing
1875 ;;
1876 diff-tree)
1877 : plumbing
1878 ;;
1879 fast-import)
1880 : import
1881 ;;
1882 fast-export)
1883 : export
1884 ;;
1885 fsck-objects)
1886 : plumbing
1887 ;;
1888 fetch-pack)
1889 : plumbing
1890 ;;
1891 fmt-merge-msg)
1892 : plumbing
1893 ;;
1894 for-each-ref)
1895 : plumbing
1896 ;;
1897 hash-object)
1898 : plumbing
1899 ;;
1900 http-*)
1901 : transport
1902 ;;
1903 index-pack)
1904 : plumbing
1905 ;;
1906 init-db)
1907 : deprecated
1908 ;;
1909 local-fetch)
1910 : plumbing
1911 ;;
1912 lost-found)
1913 : infrequent
1914 ;;
1915 ls-files)
1916 : plumbing
1917 ;;
1918 ls-remote)
1919 : plumbing
1920 ;;
1921 ls-tree)
1922 : plumbing
1923 ;;
1924 mailinfo)
1925 : plumbing
1926 ;;
1927 mailsplit)
1928 : plumbing
1929 ;;
1930 merge-*)
1931 : plumbing
1932 ;;
1933 mktree)
1934 : plumbing
1935 ;;
1936 mktag)
1937 : plumbing
1938 ;;
1939 pack-objects)
1940 : plumbing
1941 ;;
1942 pack-redundant)
1943 : plumbing
1944 ;;
1945 pack-refs)
1946 : plumbing
1947 ;;
1948 parse-remote)
1949 : plumbing
1950 ;;
1951 patch-id)
1952 : plumbing
1953 ;;
1954 peek-remote)
1955 : plumbing
1956 ;;
1957 prune)
1958 : plumbing
1959 ;;
1960 prune-packed)
1961 : plumbing
1962 ;;
1963 quiltimport)
1964 : import
1965 ;;
1966 read-tree)
1967 : plumbing
1968 ;;
1969 receive-pack)
1970 : plumbing
1971 ;;
1972 reflog)
1973 : plumbing
1974 ;;
1975 repo-config)
1976 : deprecated
1977 ;;
1978 rerere)
1979 : plumbing
1980 ;;
1981 rev-list)
1982 : plumbing
1983 ;;
1984 rev-parse)
1985 : plumbing
1986 ;;
1987 runstatus)
1988 : plumbing
1989 ;;
1990 sh-setup)
1991 : internal
1992 ;;
1993 shell)
1994 : daemon
1995 ;;
1996 show-ref)
1997 : plumbing
1998 ;;
1999 send-pack)
2000 : plumbing
2001 ;;
2002 show-index)
2003 : plumbing
2004 ;;
2005 ssh-*)
2006 : transport
2007 ;;
2008 stripspace)
2009 : plumbing
2010 ;;
2011 symbolic-ref)
2012 : plumbing
2013 ;;
2014 tar-tree)
2015 : deprecated
2016 ;;
2017 unpack-file)
2018 : plumbing
2019 ;;
2020 unpack-objects)
2021 : plumbing
2022 ;;
2023 update-index)
2024 : plumbing
2025 ;;
2026 update-ref)
2027 : plumbing
2028 ;;
2029 update-server-info)
2030 : daemon
2031 ;;
2032 upload-archive)
2033 : plumbing
2034 ;;
2035 upload-pack)
2036 : plumbing
2037 ;;
2038 write-tree)
2039 : plumbing
2040 ;;
2041 var)
2042 : infrequent
2043 ;;
2044 verify-pack)
2045 : infrequent
2046 ;;
2047 verify-tag)
2048 : plumbing
2049 ;;
2050 *)
2051 echo $i
2052 ;;
2053 esac;
2054 done
2055}
2056__git_ps1 ()
2057{
2058 local g="$(__gitdir)";
2059 if [ -n "$g" ]; then
2060 local r;
2061 local b;
2062 if [ -d "$g/rebase-apply" ]; then
2063 if [ -f "$g/rebase-apply/rebasing" ]; then
2064 r="|REBASE";
2065 else
2066 if [ -f "$g/rebase-apply/applying" ]; then
2067 r="|AM";
2068 else
2069 r="|AM/REBASE";
2070 fi;
2071 fi;
2072 b="$(git symbolic-ref HEAD 2>/dev/null)";
2073 else
2074 if [ -f "$g/rebase-merge/interactive" ]; then
2075 r="|REBASE-i";
2076 b="$(cat "$g/rebase-merge/head-name")";
2077 else
2078 if [ -d "$g/rebase-merge" ]; then
2079 r="|REBASE-m";
2080 b="$(cat "$g/rebase-merge/head-name")";
2081 else
2082 if [ -f "$g/MERGE_HEAD" ]; then
2083 r="|MERGING";
2084 fi;
2085 if [ -f "$g/BISECT_LOG" ]; then
2086 r="|BISECTING";
2087 fi;
2088 b="$(git symbolic-ref HEAD 2>/dev/null)" || {
2089 b="$(
2090 case "${GIT_PS1_DESCRIBE_STYLE-}" in
2091 (contains)
2092 git describe --contains HEAD ;;
2093 (branch)
2094 git describe --contains --all HEAD ;;
2095 (describe)
2096 git describe HEAD ;;
2097 (* | default)
2098 git describe --exact-match HEAD ;;
2099 esac 2>/dev/null)" || b="$(cut -c1-7 "$g/HEAD" 2>/dev/null)..." || b="unknown";
2100 b="($b)"
2101 };
2102 fi;
2103 fi;
2104 fi;
2105 local w;
2106 local i;
2107 local c;
2108 if [ "true" = "$(git rev-parse --is-inside-git-dir 2>/dev/null)" ]; then
2109 if [ "true" = "$(git rev-parse --is-bare-repository 2>/dev/null)" ]; then
2110 c="BARE:";
2111 else
2112 b="GIT_DIR!";
2113 fi;
2114 else
2115 if [ "true" = "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]; then
2116 if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ]; then
2117 if [ "$(git config --bool bash.showDirtyState)" != "false" ]; then
2118 git diff --no-ext-diff --ignore-submodules --quiet --exit-code || w="*";
2119 if git rev-parse --quiet --verify HEAD > /dev/null; then
2120 git diff-index --cached --quiet --ignore-submodules HEAD -- || i="+";
2121 else
2122 i="#";
2123 fi;
2124 fi;
2125 fi;
2126 fi;
2127 fi;
2128 if [ -n "$b" ]; then
2129 if [ -n "${1-}" ]; then
2130 printf "$1" "$c${b##refs/heads/}$w$i$r";
2131 else
2132 printf " (%s)" "$c${b##refs/heads/}$w$i$r";
2133 fi;
2134 fi;
2135 fi
2136}
2137__git_refs ()
2138{
2139 local i is_hash=y dir="$(__gitdir "${1-}")";
2140 local cur="${COMP_WORDS[COMP_CWORD]}" format refs;
2141 if [ -d "$dir" ]; then
2142 case "$cur" in
2143 refs | refs/*)
2144 format="refname";
2145 refs="${cur%/*}"
2146 ;;
2147 *)
2148 if [ -e "$dir/HEAD" ]; then
2149 echo HEAD;
2150 fi;
2151 format="refname:short";
2152 refs="refs/tags refs/heads refs/remotes"
2153 ;;
2154 esac;
2155 git --git-dir="$dir" for-each-ref --format="%($format)" $refs;
2156 return;
2157 fi;
2158 for i in $(git ls-remote "$dir" 2>/dev/null);
2159 do
2160 case "$is_hash,$i" in
2161 y,*)
2162 is_hash=n
2163 ;;
2164 n,*^{})
2165 is_hash=y
2166 ;;
2167 n,refs/tags/*)
2168 is_hash=y;
2169 echo "${i#refs/tags/}"
2170 ;;
2171 n,refs/heads/*)
2172 is_hash=y;
2173 echo "${i#refs/heads/}"
2174 ;;
2175 n,refs/remotes/*)
2176 is_hash=y;
2177 echo "${i#refs/remotes/}"
2178 ;;
2179 n,*)
2180 is_hash=y;
2181 echo "$i"
2182 ;;
2183 esac;
2184 done
2185}
2186__git_refs2 ()
2187{
2188 local i;
2189 for i in $(__git_refs "$1");
2190 do
2191 echo "$i:$i";
2192 done
2193}
2194__git_refs_remotes ()
2195{
2196 local cmd i is_hash=y;
2197 for i in $(git ls-remote "$1" 2>/dev/null);
2198 do
2199 case "$is_hash,$i" in
2200 n,refs/heads/*)
2201 is_hash=y;
2202 echo "$i:refs/remotes/$1/${i#refs/heads/}"
2203 ;;
2204 y,*)
2205 is_hash=n
2206 ;;
2207 n,*^{})
2208 is_hash=y
2209 ;;
2210 n,refs/tags/*)
2211 is_hash=y
2212 ;;
2213 n,*)
2214 is_hash=y
2215 ;;
2216 esac;
2217 done
2218}
2219__git_remotes ()
2220{
2221 local i ngoff IFS='
2222' d="$(__gitdir)";
2223 shopt -q nullglob || ngoff=1;
2224 shopt -s nullglob;
2225 for i in "$d/remotes"/*;
2226 do
2227 echo ${i#$d/remotes/};
2228 done;
2229 [ "$ngoff" ] && shopt -u nullglob;
2230 for i in $(git --git-dir="$d" config --list);
2231 do
2232 case "$i" in
2233 remote.*.url=*)
2234 i="${i#remote.}";
2235 echo "${i/.url=*/}"
2236 ;;
2237 esac;
2238 done
2239}
2240__git_tags ()
2241{
2242 local cmd i is_hash=y dir="$(__gitdir "${1-}")";
2243 if [ -d "$dir" ]; then
2244 git --git-dir="$dir" for-each-ref --format='%(refname:short)' refs/tags;
2245 return;
2246 fi;
2247 for i in $(git ls-remote "${1-}" 2>/dev/null);
2248 do
2249 case "$is_hash,$i" in
2250 y,*)
2251 is_hash=n
2252 ;;
2253 n,*^{})
2254 is_hash=y
2255 ;;
2256 n,refs/tags/*)
2257 is_hash=y;
2258 echo "${i#refs/tags/}"
2259 ;;
2260 n,*)
2261 is_hash=y;
2262 echo "$i"
2263 ;;
2264 esac;
2265 done
2266}
2267__gitcomp ()
2268{
2269 local cur="${COMP_WORDS[COMP_CWORD]}";
2270 if [ $# -gt 2 ]; then
2271 cur="$3";
2272 fi;
2273 case "$cur" in
2274 --*=)
2275 COMPREPLY=()
2276 ;;
2277 *)
2278 local IFS='
2279';
2280 COMPREPLY=($(compgen -P "${2-}" -W "$(__gitcomp_1 "${1-}" "${4-}")" -- "$cur"))
2281 ;;
2282 esac
2283}
2284__gitcomp_1 ()
2285{
2286 local c IFS=' '' ''
2287';
2288 for c in $1;
2289 do
2290 case "$c$2" in
2291 --*=*)
2292 printf %s'
2293' "$c$2"
2294 ;;
2295 *.)
2296 printf %s'
2297' "$c$2"
2298 ;;
2299 *)
2300 printf %s'
2301' "$c$2 "
2302 ;;
2303 esac;
2304 done
2305}
2306__gitdir ()
2307{
2308 if [ -z "${1-}" ]; then
2309 if [ -n "${__git_dir-}" ]; then
2310 echo "$__git_dir";
2311 else
2312 if [ -d .git ]; then
2313 echo .git;
2314 else
2315 git rev-parse --git-dir 2> /dev/null;
2316 fi;
2317 fi;
2318 else
2319 if [ -d "$1/.git" ]; then
2320 echo "$1/.git";
2321 else
2322 echo "$1";
2323 fi;
2324 fi
2325}
2326_add_members ()
2327{
2328 local cur prev;
2329 COMPREPLY=();
2330 cur=`_get_cword`;
2331 prev=${COMP_WORDS[COMP_CWORD-1]};
2332 case "$prev" in
2333 -@(r|d|-regular-members-file=|-digest-members-file=))
2334 _filedir;
2335 return 0
2336 ;;
2337 -@(w|a|-welcome-msg=|-admin-notify=))
2338 COMPREPLY=($( compgen -W 'y n' -- $cur));
2339 return 0
2340 ;;
2341 esac;
2342 if [[ "$cur" == -* ]]; then
2343 COMPREPLY=($( compgen -W '--regular-members-file= -r \
2344 --digest-members-file= -d --welcome-msg= -w \
2345 --admin-notify= -a --help -h' -- $cur ));
2346 else
2347 _mailman_lists;
2348 fi
2349}
2350_alias ()
2351{
2352 local cur;
2353 COMPREPLY=();
2354 cur=`_get_cword`;
2355 case "$COMP_LINE" in
2356 *[^=])
2357 COMPREPLY=($( compgen -A alias -- $cur ))
2358 ;;
2359 *=)
2360 COMPREPLY=("$( alias ${cur%=} 2>/dev/null | sed -e 's|^alias '$cur'\(.*\)$|\1|' )")
2361 ;;
2362 esac
2363}
2364_apt_cache ()
2365{
2366 local cur prev special i;
2367 COMPREPLY=();
2368 cur=`_get_cword`;
2369 prev=${COMP_WORDS[COMP_CWORD-1]};
2370 if [ "$cur" != show ]; then
2371 for ((i=0; i < ${#COMP_WORDS[@]}-1; i++ ))
2372 do
2373 if [[ ${COMP_WORDS[i]} == @(add|depends|dotty|madison|policy|rdepends|show?(pkg|src|)) ]]; then
2374 special=${COMP_WORDS[i]};
2375 fi;
2376 done;
2377 fi;
2378 if [ -n "$special" ]; then
2379 case $special in
2380 add)
2381 _filedir;
2382 return 0
2383 ;;
2384 showsrc)
2385 COMPREPLY=($( apt-cache dumpavail | grep "^Source: $cur" | sort | uniq | cut -f2 -d" " ));
2386 return 0
2387 ;;
2388 *)
2389 COMPREPLY=($( apt-cache pkgnames $cur 2> /dev/null ));
2390 return 0
2391 ;;
2392 esac;
2393 fi;
2394 case "$prev" in
2395 -@(c|p|s|-config-file|-@(pkg|src)-cache))
2396 _filedir;
2397 return 0
2398 ;;
2399 search)
2400 if [[ "$cur" != -* ]]; then
2401 return 0;
2402 fi
2403 ;;
2404 esac;
2405 if [[ "$cur" == -* ]]; then
2406 COMPREPLY=($( compgen -W '-h -v -p -s -q -i -f -a -g -c \
2407 -o --help --version --pkg-cache --src-cache \
2408 --quiet --important --full --all-versions \
2409 --no-all-versions --generate --no-generate \
2410 --names-only --all-names --recurse \
2411 --config-file --option --installed' -- $cur ));
2412 else
2413 COMPREPLY=($( compgen -W 'add gencaches show showpkg showsrc \
2414 stats dump dumpavail unmet search search \
2415 depends rdepends pkgnames dotty xvcg \
2416 policy madison' -- $cur ));
2417 fi;
2418 return 0
2419}
2420_apt_get ()
2421{
2422 local cur prev special i;
2423 COMPREPLY=();
2424 cur=`_get_cword`;
2425 prev=${COMP_WORDS[COMP_CWORD-1]};
2426 for ((i=0; i < ${#COMP_WORDS[@]}-1; i++ ))
2427 do
2428 if [[ ${COMP_WORDS[i]} == @(install|remove|autoremove|purge|source|build-dep) ]]; then
2429 special=${COMP_WORDS[i]};
2430 fi;
2431 done;
2432 if [ -n "$special" ]; then
2433 case $special in
2434 remove | autoremove | purge)
2435 if [ -f /etc/debian_version ]; then
2436 COMPREPLY=($( _comp_dpkg_installed_packages $cur ));
2437 else
2438 _rpm_installed_packages;
2439 fi;
2440 return 0
2441 ;;
2442 *)
2443 COMPREPLY=($( apt-cache pkgnames $cur 2> /dev/null ));
2444 return 0
2445 ;;
2446 esac;
2447 fi;
2448 case "$prev" in
2449 -@(c|-config-file))
2450 _filedir;
2451 return 0
2452 ;;
2453 -@(t|-target-release|-default-release))
2454 COMPREPLY=($( apt-cache policy | grep "release.o=Debian,a=$cur" | sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2> /dev/null));
2455 return 0
2456 ;;
2457 esac;
2458 if [[ "$cur" == -* ]]; then
2459 COMPREPLY=($( compgen -W '-d -f -h -v -m -q -s -y \
2460 -u -t -b -c -o --download-only --fix-broken \
2461 --help --version --ignore-missing \
2462 --fix-missing --no-download --quiet --simulate \
2463 --just-print --dry-run --recon --no-act --yes \
2464 --assume-yes --show-upgraded --only-source \
2465 --compile --build --ignore-hold \
2466 --target-release --no-upgrade --force-yes \
2467 --print-uris --purge --reinstall \
2468 --list-cleanup --default-release \
2469 --trivial-only --no-remove --diff-only \
2470 --no-install-recommends \
2471 --tar-only --config-file --option --auto-remove' -- $cur ));
2472 else
2473 COMPREPLY=($( compgen -W 'update upgrade dselect-upgrade \
2474 dist-upgrade install remove purge source build-dep \
2475 check clean autoclean autoremove' -- $cur ));
2476 fi;
2477 return 0
2478}
2479_aptitude ()
2480{
2481 local cur dashoptions prev special i;
2482 COMPREPLY=();
2483 cur=`_get_cword`;
2484 prev=${COMP_WORDS[COMP_CWORD-1]};
2485 dashoptions='-S -u -i -h --help --version -s --simulate -d \
2486 --download-only -P --prompt -y --assume-yes -F \
2487 --display-format -O --sort -w --width -f -r -g \
2488 --with-recommends --with-suggests -R -G \
2489 --without-recommends --without-suggests -t \
2490 --target-release -V --show-versions -D --show-deps\
2491 -Z -v --verbose --purge-unused --schedule-only';
2492 for ((i=0; i < ${#COMP_WORDS[@]}-1; i++ ))
2493 do
2494 if [[ ${COMP_WORDS[i]} == @(install|reinstall|hold|unhold|markauto|unmarkauto|dist-upgrade|full-upgrade|download|show|forbid-version|purge|remove|changelog|why|why-not|keep|keep-all|build-dep) ]]; then
2495 special=${COMP_WORDS[i]};
2496 fi;
2497 [[ ${COMP_WORDS[i]} == '-u' ]] && dashoptions=${dashoptions/-i};
2498 [[ ${COMP_WORDS[i]} == '-i' ]] && dashoptions=${dashoptions/-u};
2499 done;
2500 if [[ -n "$special" ]]; then
2501 case $special in
2502 @(install|hold|markauto|unmarkauto|dist-upgrade|full-upgrade|download|show|changelog|why|why-not|build-dep))
2503 COMPREPLY=($( apt-cache pkgnames $cur 2> /dev/null ));
2504 return 0
2505 ;;
2506 @(purge|remove|reinstall|forbid-version))
2507 COMPREPLY=($( _comp_dpkg_installed_packages $cur ));
2508 return 0
2509 ;;
2510 unhold)
2511 COMPREPLY=($( _comp_dpkg_hold_packages $cur ));
2512 return 0
2513 ;;
2514 esac;
2515 fi;
2516 case $prev in
2517 @(autoclean|clean|forget-new|search|upgrade|safe-upgrade|update|keep-all))
2518 return 0
2519 ;;
2520 -S)
2521 _filedir;
2522 return 0
2523 ;;
2524 -@(t|-target-release|-default-release))
2525 COMPREPLY=($( apt-cache policy | grep "release.o=Debian,a=$cur" | sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2> /dev/null ));
2526 return 0
2527 ;;
2528 esac;
2529 if [[ "$cur" == -* ]]; then
2530 COMPREPLY=($( compgen -W "$dashoptions" -- $cur ));
2531 else
2532 COMPREPLY=($( compgen -W 'update upgrade safe-upgrade forget-new clean \
2533 autoclean install reinstall remove \
2534 hold unhold purge markauto unmarkauto why why-not \
2535 dist-upgrade full-upgrade download search show \
2536 forbid-version changelog keep-all build-dep' -- $cur ));
2537 fi;
2538 return 0
2539}
2540_arch ()
2541{
2542 local cur prev;
2543 COMPREPLY=();
2544 cur=`_get_cword`;
2545 prev=${COMP_WORDS[COMP_CWORD-1]};
2546 case "$prev" in
2547 -@(w|g|d|--welcome-msg=|-goodbye-msg|-digest=))
2548 COMPREPLY=($( compgen -W 'y n' -- $cur));
2549 return 0
2550 ;;
2551 -@(d|-file))
2552 _filedir;
2553 return 0
2554 ;;
2555 esac;
2556 if [[ "$cur" == -* ]]; then
2557 COMPREPLY=($( compgen -W '--wipe -s --start= -e --end= \
2558 -q --quiet -h --help' -- $cur ));
2559 else
2560 args=$COMP_CWORD;
2561 for ((i=1; i < COMP_CWORD; i++ ))
2562 do
2563 if [[ "${COMP_WORDS[i]}" == -* ]]; then
2564 args=$(($args-1));
2565 fi;
2566 done;
2567 case $args in
2568 1)
2569 _mailman_lists
2570 ;;
2571 2)
2572 _filedir
2573 ;;
2574 esac;
2575 fi
2576}
2577_arpspoof ()
2578{
2579 local cur;
2580 COMPREPLY=();
2581 cur=`_get_cword`;
2582 prev=${COMP_WORDS[COMP_CWORD-1]};
2583 case "$prev" in
2584 -i)
2585 _interfaces;
2586 return 0
2587 ;;
2588 -t)
2589 _known_hosts;
2590 return 0
2591 ;;
2592 esac;
2593 if [[ "$cur" == -* ]]; then
2594 COMPREPLY=($( compgen -W '-i -t' -- $cur ));
2595 else
2596 _known_hosts;
2597 fi
2598}
2599_available_interfaces ()
2600{
2601 local cmd;
2602 if [ "${1:-}" = -w ]; then
2603 cmd="iwconfig";
2604 else
2605 if [ "${1:-}" = -a ]; then
2606 cmd="ifconfig";
2607 else
2608 cmd="ifconfig -a";
2609 fi;
2610 fi;
2611 COMPREPLY=($( eval $cmd 2>/dev/null | sed -ne 's|^\('$cur'[^[:space:][:punct:]]\{1,\}\).*$|\1|p'))
2612}
2613_bk ()
2614{
2615 local BKCMDS;
2616 COMPREPLY=();
2617 cur=`_get_cword`;
2618 BKCMDS="$( bk help topics | grep '^ bk' | cut -d ' ' -f 4 | xargs echo )";
2619 COMPREPLY=($( compgen -W "$BKCMDS" -- "$cur" ));
2620 _filedir;
2621 return 0
2622}
2623_btdownload ()
2624{
2625 local cur prev;
2626 COMPREPLY=();
2627 cur=`_get_cword`;
2628 prev=${COMP_WORDS[COMP_CWORD-1]};
2629 case "$prev" in
2630 --@(responsefile|saveas))
2631 _filedir;
2632 return 0
2633 ;;
2634 esac;
2635 if [[ "$cur" == -* ]]; then
2636 COMPREPLY=($( compgen -W '--max_uploads --keepalive_interval \
2637 --download_slice_size --request_backlog \
2638 --max_message_length --ip --minport --maxport \
2639 --responsefile --url --saveas --timeout \
2640 --timeout_check_interval --max_slice_length \
2641 --max_rate_period --bind --upload_rate_fudge \
2642 --display_interval --rerequest_interval \
2643 --min_peers --http_timeout --max_initiate \
2644 --max_allow_in --check_hashes \
2645 --max_upload_rate --snub_time --spew \
2646 --rarest_first_cutoff --min_uploads \
2647 --report_hash_failures' -- $cur ));
2648 else
2649 _filedir;
2650 fi
2651}
2652_bzip2 ()
2653{
2654 local cur prev xspec;
2655 COMPREPLY=();
2656 cur=`_get_cword`;
2657 prev=${COMP_WORDS[COMP_CWORD-1]};
2658 if [[ "$cur" == -* ]]; then
2659 COMPREPLY=($( compgen -W '-c -d -f -h -k -L -q -s \
2660 -t -v -V -z -1 -2 -3 -4 -5 -6 -7 -8 -9 \
2661 --help --decompress --compress --keep --force \
2662 --test --stdout --quiet --verbose --license \
2663 --version --small --fast --best' -- $cur ));
2664 return 0;
2665 fi;
2666 local IFS='
2667';
2668 xspec="*.bz2";
2669 if [[ "$prev" == --* ]]; then
2670 [[ "$prev" == --decompress || "$prev" == --list || "$prev" == --test ]] && xspec="!"$xspec;
2671 [[ "$prev" == --compress ]] && xspec=;
2672 else
2673 if [[ "$prev" == -* ]]; then
2674 [[ "$prev" == -*[dt]* ]] && xspec="!"$xspec;
2675 [[ "$prev" == -*z* ]] && xspec=;
2676 fi;
2677 fi;
2678 _expand || return 0;
2679 COMPREPLY=($( compgen -f -X "$xspec" -- $cur ) $( compgen -d -- $cur ))
2680}
2681_cd ()
2682{
2683 local IFS='
2684' cur=`_get_cword` i j k;
2685 if [[ "$cur" == ?(\\)\$* ]]; then
2686 COMPREPLY=($( compgen -v -P '$' -- "${cur#?(\\)$}" ));
2687 return 0;
2688 fi;
2689 compgen -f /non-existing-dir/ > /dev/null;
2690 if [ -z "${CDPATH:-}" ] || [[ "$cur" == ?(.)?(.)/* ]]; then
2691 _filedir -d;
2692 return 0;
2693 fi;
2694 local -r mark_dirs=$(_rl_enabled mark-directories && echo y);
2695 local -r mark_symdirs=$(_rl_enabled mark-symlinked-directories && echo y);
2696 for i in ${CDPATH//:/' '};
2697 do
2698 k="${#COMPREPLY[@]}";
2699 for j in $( compgen -d $i/$cur );
2700 do
2701 if [[ ( -n $mark_symdirs && -h $j || -n $mark_dirs && ! -h $j ) && ! -d ${j#$i/} ]]; then
2702 j="${j}/";
2703 fi;
2704 COMPREPLY[k++]=${j#$i/};
2705 done;
2706 done;
2707 _filedir -d;
2708 if [[ ${#COMPREPLY[@]} -eq 1 ]]; then
2709 i=${COMPREPLY[0]};
2710 if [ "$i" == "$cur" ] && [[ $i != "*/" ]]; then
2711 COMPREPLY[0]="${i}/";
2712 fi;
2713 fi;
2714 return 0
2715}
2716_change_pw ()
2717{
2718 local cur prev;
2719 COMPREPLY=();
2720 cur=`_get_cword`;
2721 prev=${COMP_WORDS[COMP_CWORD-1]};
2722 case "$prev" in
2723 -@(l|-listname=))
2724 _mailman_lists;
2725 return 0
2726 ;;
2727 esac;
2728 if [[ "$cur" == -* ]]; then
2729 COMPREPLY=($( compgen -W '-a --all --domain= -d --listname= -l \
2730 --password= -p --quiet -q -h --help' -- $cur ));
2731 fi
2732}
2733_check_db ()
2734{
2735 local cur;
2736 COMPREPLY=();
2737 cur=`_get_cword`;
2738 if [[ "$cur" == -* ]]; then
2739 COMPREPLY=($( compgen -W '--all -a --verbose -v \
2740 -h --help' -- $cur ));
2741 else
2742 _mailman_lists;
2743 fi
2744}
2745_check_perms ()
2746{
2747 local cur;
2748 COMPREPLY=();
2749 cur=`_get_cword`;
2750 if [[ "$cur" == -* ]]; then
2751 COMPREPLY=($( compgen -W '-f -v -h' -- $cur ));
2752 fi
2753}
2754_chgrp ()
2755{
2756 local cur prev;
2757 COMPREPLY=();
2758 cur=`_get_cword`;
2759 cur=${cur//\\\\/};
2760 prev=${COMP_WORDS[COMP_CWORD-1]};
2761 if [[ "$cur" == -* ]]; then
2762 COMPREPLY=($( compgen -W '-c -h -f -R -v --changes \
2763 --dereference --no-dereference --silent --quiet \
2764 --reference= --recursive --verbose --help --version' -- $cur ));
2765 return 0;
2766 fi;
2767 if [ $COMP_CWORD -eq 1 ] && [[ "$cur" != -* ]] || [[ "$prev" == -* ]] && [ -n "$bash205" ]; then
2768 local IFS='
2769';
2770 COMPREPLY=($( compgen -g $cur 2>/dev/null ));
2771 else
2772 _filedir || return 0;
2773 fi;
2774 return 0
2775}
2776_chkconfig ()
2777{
2778 local cur prev;
2779 COMPREPLY=();
2780 cur=`_get_cword`;
2781 prev=${COMP_WORDS[COMP_CWORD-1]};
2782 case "$prev" in
2783 @([1-6]|--@(list|add|del)))
2784 _services;
2785 return 0
2786 ;;
2787 --level)
2788 COMPREPLY=($( compgen -W '1 2 3 4 5 6' -- $cur ));
2789 return 0
2790 ;;
2791 esac;
2792 if [[ "$cur" == -* ]]; then
2793 COMPREPLY=($( compgen -W '--list --add --del --level' -- $cur ));
2794 else
2795 if [ $COMP_CWORD -eq 2 -o $COMP_CWORD -eq 4 ]; then
2796 COMPREPLY=($( compgen -W 'on off reset' -- $cur ));
2797 else
2798 _services;
2799 fi;
2800 fi
2801}
2802_chown ()
2803{
2804 local cur;
2805 cur=`_get_cword`;
2806 if [[ "$cur" == -* ]]; then
2807 COMPREPLY=($( compgen -W '-c -h -f -R -v --changes \
2808 --dereference --no-dereference --from= --silent --quiet \
2809 --reference= --recursive --verbose --help --version' -- $cur ));
2810 else
2811 _count_args;
2812 case $args in
2813 1)
2814 _usergroup
2815 ;;
2816 *)
2817 _filedir
2818 ;;
2819 esac;
2820 fi
2821}
2822_chsh ()
2823{
2824 local cur prev;
2825 COMPREPLY=();
2826 cur=`_get_cword`;
2827 prev=${COMP_WORDS[COMP_CWORD-1]};
2828 if [ "$prev" = "-s" ]; then
2829 if [ -f /etc/debian_version ]; then
2830 COMPREPLY=($( </etc/shells ));
2831 else
2832 COMPREPLY=($( chsh -l | grep "^$cur" ));
2833 fi;
2834 else
2835 COMPREPLY=($( compgen -u -- $cur ));
2836 fi;
2837 return 0
2838}
2839_civclient ()
2840{
2841 local cur;
2842 COMPREPLY=();
2843 cur=`_get_cword`;
2844 prev=${COMP_WORDS[COMP_CWORD-1]};
2845 case "$prev" in
2846 -@(l|S|t|-log|-Sound|-tiles))
2847 _filedir;
2848 return 0
2849 ;;
2850 -@(P|-Plugin))
2851 COMPREPLY=($( compgen -W 'none esd sdl' -- $cur ));
2852 return 0
2853 ;;
2854 -@(s|-server))
2855 _known_hosts;
2856 return 0
2857 ;;
2858 esac;
2859 if [[ "$cur" == -* ]]; then
2860 COMPREPLY=($( compgen -W '-a -d -h -l -m -n -p -P -s -S -t -v\
2861 --autoconnect --debug --help --log --meta --name \
2862 --port --Plugin --server --Sound --tiles --version' -- $cur ));
2863 fi
2864}
2865_civserver ()
2866{
2867 local cur;
2868 COMPREPLY=();
2869 cur=`_get_cword`;
2870 prev=${COMP_WORDS[COMP_CWORD-1]};
2871 case "$prev" in
2872 -@(f|g|l|r|-file|-log|-gamelog|-read))
2873 _filedir;
2874 return 0
2875 ;;
2876 esac;
2877 if [[ "$cur" == -* ]]; then
2878 COMPREPLY=($( compgen -W '-d -f -g -h -i -l -m -M -p -q -r -v\
2879 --debug --file --gamelog --help --info --log --meta \
2880 --Metaserver --port --quitidle --read --version' -- $cur ));
2881 fi
2882}
2883_cksfv ()
2884{
2885 COMPREPLY=();
2886 cur=`_get_cword`;
2887 if [ $COMP_CWORD -eq 1 ]; then
2888 COMPREPLY=($( compgen -W '-C -f -i -q -v' -- $cur ));
2889 return 0;
2890 fi;
2891 case "${COMP_WORDS[$COMP_CWORD-1]}" in
2892 -C)
2893 _filedir -d;
2894 return 0
2895 ;;
2896 -f)
2897 _filedir 'sfv';
2898 return 0
2899 ;;
2900 esac;
2901 _filedir;
2902 return 0
2903}
2904_cleanarch ()
2905{
2906 local cur;
2907 COMPREPLY=();
2908 cur=`_get_cword`;
2909 if [[ "$cur" == -* ]]; then
2910 COMPREPLY=($( compgen -W '-s --status -n --dry-run \
2911 -q --quiet -h --help' -- $cur ));
2912 fi
2913}
2914_clisp ()
2915{
2916 local cur;
2917 COMPREPLY=();
2918 cur=`_get_cword`;
2919 if [[ "$cur" == -* ]]; then
2920 COMPREPLY=($( compgen -W '-h --help --version --license -B -K \
2921 -M -m -L -N -E -q --quiet --silent -w -I -ansi \
2922 -traditional -p -C -norc -i -c -l -o -x ' -- $cur ));
2923 else
2924 _filedir;
2925 fi;
2926 return 0
2927}
2928_clone_member ()
2929{
2930 local cur prev;
2931 COMPREPLY=();
2932 cur=`_get_cword`;
2933 prev=${COMP_WORDS[COMP_CWORD-1]};
2934 case "$prev" in
2935 -@(l|-listname=))
2936 _mailman_lists;
2937 return 0
2938 ;;
2939 esac;
2940 if [[ "$cur" == -* ]]; then
2941 COMPREPLY=($( compgen -W '-l --listname= --remove -r \
2942 --admin -a --quiet -q --nomodify -n --help -h' -- $cur ));
2943 fi
2944}
2945_command ()
2946{
2947 local offset i;
2948 offset=1;
2949 for ((i=1; i <= COMP_CWORD; i++ ))
2950 do
2951 if [[ "${COMP_WORDS[i]}" != -* ]]; then
2952 offset=$i;
2953 break;
2954 fi;
2955 done;
2956 _command_offset $offset
2957}
2958_command_offset ()
2959{
2960 local cur func cline cspec noglob cmd i char_offset word_offset _COMMAND_FUNC _COMMAND_FUNC_ARGS;
2961 word_offset=$1;
2962 local first_word=${COMP_WORDS[$word_offset]};
2963 for ((i=0; i <= ${#COMP_LINE}; i++ ))
2964 do
2965 if [[ "${COMP_LINE:$i:${#first_word}}" == "$first_word" ]]; then
2966 char_offset=$i;
2967 break;
2968 fi;
2969 done;
2970 COMP_LINE=${COMP_LINE:$char_offset};
2971 COMP_POINT=$(( COMP_POINT - $char_offset ));
2972 for ((i=0; i <= COMP_CWORD - $word_offset; i++ ))
2973 do
2974 COMP_WORDS[i]=${COMP_WORDS[i+$word_offset]};
2975 done;
2976 for ((i; i <= COMP_CWORD; i++ ))
2977 do
2978 unset COMP_WORDS[i];
2979 done;
2980 COMP_CWORD=$(( $COMP_CWORD - $word_offset ));
2981 COMPREPLY=();
2982 cur=`_get_cword`;
2983 if [[ $COMP_CWORD -eq 0 ]]; then
2984 COMPREPLY=($( compgen -c -- $cur ));
2985 else
2986 cmd=${COMP_WORDS[0]};
2987 if complete -p $cmd &>/dev/null; then
2988 cspec=$( complete -p $cmd );
2989 if [ "${cspec#* -F }" != "$cspec" ]; then
2990 func=${cspec#*-F };
2991 func=${func%% *};
2992 if [[ ${#COMP_WORDS[@]} -ge 2 ]]; then
2993 $func $cmd "${COMP_WORDS[${#COMP_WORDS[@]}-1]}" "${COMP_WORDS[${#COMP_WORDS[@]}-2]}";
2994 else
2995 $func $cmd "${COMP_WORDS[${#COMP_WORDS[@]}-1]}";
2996 fi;
2997 if [ "${cspec#*-o }" != "$cspec" ]; then
2998 cspec=${cspec#*-o };
2999 cspec=${cspec%% *};
3000 if [[ "$cspec" != @(dir|file)names ]]; then
3001 COMPREPLY=("${COMPREPLY[@]//\\\\:/:}");
3002 fi;
3003 fi;
3004 else
3005 if [ -n "$cspec" ]; then
3006 cspec=${cspec#complete};
3007 cspec=${cspec%%$cmd};
3008 COMPREPLY=($( eval compgen "$cspec" -- "$cur" ));
3009 fi;
3010 fi;
3011 fi;
3012 fi;
3013 [ ${#COMPREPLY[@]} -eq 0 ] && _filedir
3014}
3015_comp_dpkg_hold_packages ()
3016{
3017 grep --color=auto -B 2 'hold' /var/lib/dpkg/status | grep --color=auto "Package: $1" | cut -d\ -f2
3018}
3019_comp_dpkg_installed_packages ()
3020{
3021 grep --color=auto -A 1 "Package: $1" /var/lib/dpkg/status | grep --color=auto -B 1 -Ee "ok installed|half-installed|unpacked| half-configured|config-files" -Ee "^Essential: yes" | grep --color=auto "Package: $1" | cut -d\ -f2
3022}
3023_complete ()
3024{
3025 local cur prev options;
3026 COMPREPLY=();
3027 cur=`_get_cword`;
3028 prev=${COMP_WORDS[COMP_CWORD-1]};
3029 case $prev in
3030 -o)
3031 options="default dirnames filenames";
3032 [ -n "$bash205b" ] && options="$options nospace";
3033 [ -n "$bash3" ] && options="$options bashdefault plusdirs";
3034 COMPREPLY=($( compgen -W "$options" -- $cur ));
3035 return 0
3036 ;;
3037 -A)
3038 COMPREPLY=($( compgen -W 'alias arrayvar binding \
3039 builtin command directory disabled enabled \
3040 export file function group helptopic hostname \
3041 job keyword running service setopt shopt \
3042 signal stopped user variable' -- $cur ));
3043 return 0
3044 ;;
3045 -C)
3046 COMPREPLY=($( compgen -A command -- $cur ));
3047 return 0
3048 ;;
3049 -F)
3050 COMPREPLY=($( compgen -A function -- $cur ));
3051 return 0
3052 ;;
3053 -@(p|r))
3054 COMPREPLY=($( complete -p | sed -e 's|.* ||' | grep "^$cur" ));
3055 return 0
3056 ;;
3057 esac;
3058 if [[ "$cur" == -* ]]; then
3059 options="-a -b -c -d -e -f -g -j -k -s -v -u -A -G -W -P -S -X -F -C";
3060 [ -n "$bash205" ] && options="$options -o";
3061 COMPREPLY=($( compgen -W "$options" -- $cur ));
3062 else
3063 COMPREPLY=($( compgen -A command -- $cur ));
3064 fi
3065}
3066_config_list ()
3067{
3068 local cur prev;
3069 COMPREPLY=();
3070 cur=`_get_cword`;
3071 prev=${COMP_WORDS[COMP_CWORD-1]};
3072 case "$prev" in
3073 -@(i|o|-inputfile|-outputfile))
3074 _filedir;
3075 return 0
3076 ;;
3077 esac;
3078 if [[ "$cur" == -* ]]; then
3079 COMPREPLY=($( compgen -W '--inputfile -i --outputfile -o \
3080 --checkonly -c --verbose -v -h --help' -- $cur ));
3081 else
3082 _mailman_lists;
3083 fi
3084}
3085_configure_func ()
3086{
3087 local cur;
3088 COMPREPLY=();
3089 cur=`_get_cword`;
3090 [[ "$cur" != -* ]] && return 0;
3091 if [ -n "$COMP_CONFIGURE_HINTS" ]; then
3092 COMPREPLY=($( $1 --help 2>&1 | awk '/^ --[A-Za-z]/ { print $1; if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,].*//g' | grep ^$cur ));
3093 else
3094 COMPREPLY=($( $1 --help 2>&1 | awk '/^ --[A-Za-z]/ { print $1; if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,=].*//g' | grep ^$cur ));
3095 fi
3096}
3097_configured_interfaces ()
3098{
3099 if [ -f /etc/debian_version ]; then
3100 COMPREPLY=($( sed -ne 's|^iface \([^ ]\+\).*$|\1|p' /etc/network/interfaces ));
3101 else
3102 if [ -f /etc/SuSE-release ]; then
3103 COMPREPLY=($( command ls /etc/sysconfig/network/ifcfg-* | sed -ne 's|.*ifcfg-\('$cur'.*\)|\1|p' ));
3104 else
3105 if [ -f /etc/pld-release ]; then
3106 COMPREPLY=($( command ls -B /etc/sysconfig/interfaces | sed -ne 's|.*ifcfg-\('$cur'.*\)|\1|p' ));
3107 else
3108 COMPREPLY=($( command ls /etc/sysconfig/network-scripts/ifcfg-* | sed -ne 's|.*ifcfg-\('$cur'.*\)|\1|p' ));
3109 fi;
3110 fi;
3111 fi
3112}
3113_count_args ()
3114{
3115 args=1;
3116 for ((i=1; i < COMP_CWORD; i++ ))
3117 do
3118 if [[ "${COMP_WORDS[i]}" != -* ]]; then
3119 args=$(($args+1));
3120 fi;
3121 done
3122}
3123_cpan2dist ()
3124{
3125 local cur prev packagelist cpandirs;
3126 COMPREPLY=();
3127 cur=`_get_cword`;
3128 prev=${COMP_WORDS[COMP_CWORD-1]};
3129 case $prev in
3130 --format)
3131 COMPREPLY=($( compgen -W '$(perl -MCPANPLUS::Dist -e "print map { \"\$_\n\" } CPANPLUS::Dist->dist_types")' -- "$cur" ));
3132 return 0
3133 ;;
3134 --@(banlist|ignorelist|modulelist|logfile))
3135 _filedir;
3136 return 0
3137 ;;
3138 esac;
3139 if [[ "$cur" == -* ]]; then
3140 COMPREPLY=($( compgen -W '--help --skiptest --force --install \
3141 --verbose --keepsource --makefile --buildprereq \
3142 --archive --flushcache --defaults --edit-metafile \
3143 --format --ban --banlist --ignore --ignorelist \
3144 --modulelist --logfile --timeout --set-config \
3145 --set-program --dist-opts --default-banlist \
3146 --default-ignorelist' -- $cur ));
3147 else
3148 cpandirs=("$HOME/.cpanplus/" "$HOME/.cpan/source/modules/");
3149 for dir in ${cpandirs[@]};
3150 do
3151 [ -d "$dir" -a -r "$dir/02packages.details.txt.gz" ] && packagelist="$dir/02packages.details.txt.gz";
3152 done;
3153 COMPREPLY=($( zgrep "^${cur//-/::}" $packagelist 2>/dev/null | awk '{print $1}' | sed -e 's/::/-/g' ));
3154 fi
3155}
3156_cpio ()
3157{
3158 local cur;
3159 COMPREPLY=();
3160 cur=`_get_cword`;
3161 prev=${COMP_WORDS[COMP_CWORD-1]};
3162 case $prev in
3163 -H)
3164 _cpio_format;
3165 return 0
3166 ;;
3167 -@(E|F|I))
3168 _filedir;
3169 return 0
3170 ;;
3171 -R)
3172 _usergroup;
3173 return 0
3174 ;;
3175 esac;
3176 if [[ "$cur" == *=* ]]; then
3177 prev=${cur/=*/};
3178 cur=${cur/*=/};
3179 case $prev in
3180 --format)
3181 _cpio_format;
3182 return 0
3183 ;;
3184 --@(file|pattern-file))
3185 _filedir;
3186 return 0
3187 ;;
3188 --owner)
3189 _usergroup;
3190 return 0
3191 ;;
3192 --rsh-command)
3193 COMPREPLY=($( compgen -c -- $cur ));
3194 return 0
3195 ;;
3196 esac;
3197 fi;
3198 if [ $COMP_CWORD -eq 1 ]; then
3199 COMPREPLY=($( compgen -W '-o --create -i --extract -p --pass-through' -- $cur));
3200 else
3201 case ${COMP_WORDS[1]} in
3202 -@(o|-create))
3203 if [[ "$cur" == -* ]]; then
3204 COMPREPLY=($( compgen -W '-0 -a -c -v -A -B\
3205 -L -V -C -H -M -O -F --file= --format=\
3206 --message= --null --reset-access-time\
3207 --verbose --dot --append --block-size=\
3208 --dereference --io-size= --quiet\
3209 --force-local --rsh-command= --help\
3210 --version' -- $cur ));
3211 fi
3212 ;;
3213 -@(i|-extract))
3214 if [[ "$cur" == -* ]]; then
3215 COMPREPLY=($( compgen -W '-b -c -d -f -m -n -r\
3216 -t -s -u -v -B -S -V -C -E -H -M -R -I\
3217 -F --file= --make-directories\
3218 --nonmatching\
3219 --preserve-modification-time\
3220 --numeric-uid-gid --rename -t --list\
3221 --swap-bytes --swap --dot\
3222 --unconditional --verbose --block-size=\
3223 --swap-halfwords --io-size=\
3224 --pattern-file= --format= --owner=\
3225 --no-preserve-owner --message=\
3226 --force-local --no-absolute-filenames\
3227 --sparse --only-verify-crc --quiet\
3228 --rsh-command= --help\
3229 --version' -- $cur ));
3230 fi
3231 ;;
3232 -@(p|-pass-through))
3233 if [[ "$cur" == -* ]]; then
3234 COMPREPLY=($( compgen -W '-0 -a -d -l -m -u -v\
3235 -L -V -R --null --reset-access-time\
3236 --make-directories --link --quiet\
3237 --preserve-modification-time\
3238 --unconditional --verbose --dot\
3239 --dereference --owner=\
3240 --no-preserve-owner --sparse --help\
3241 --version' -- $cur ));
3242 else
3243 _filedir -d;
3244 fi
3245 ;;
3246 esac;
3247 fi
3248}
3249_cpio_format ()
3250{
3251 COMPREPLY=($( compgen -W 'bin odc newc crc tar ustar hpbin hpodc' -- $cur ))
3252}
3253_cvs ()
3254{
3255 local cur count mode i cvsroot cvsroots pwd;
3256 local -a flags miss files entries changed newremoved;
3257 COMPREPLY=();
3258 cur=`_get_cword`;
3259 count=0;
3260 for i in "${COMP_WORDS[@]}";
3261 do
3262 [ $count -eq $COMP_CWORD ] && break;
3263 if [ "${COMP_WORDS[((count))]}" == "$cvsroot" -a "$mode" == "cvsroot" ]; then
3264 mode="";
3265 fi;
3266 if [ -z "$mode" ]; then
3267 case $i in
3268 -d)
3269 mode=cvsroot;
3270 cvsroot=${COMP_WORDS[((count+1))]}
3271 ;;
3272 @(ad?(d)|new))
3273 mode=add
3274 ;;
3275 @(adm?(in)|rcs))
3276 mode=admin
3277 ;;
3278 ann?(notate))
3279 mode=annotate
3280 ;;
3281 @(checkout|co|get))
3282 mode=checkout
3283 ;;
3284 @(com?(mit)|ci))
3285 mode=commit
3286 ;;
3287 di?(f?(f)))
3288 mode=diff
3289 ;;
3290 ex?(p?(ort)))
3291 mode=export
3292 ;;
3293 ?(un)edit)
3294 mode=$i
3295 ;;
3296 hi?(s?(tory)))
3297 mode=history
3298 ;;
3299 im?(p?(ort)))
3300 mode=import
3301 ;;
3302 re?(l?(ease)))
3303 mode=release
3304 ;;
3305 ?(r)log)
3306 mode=log
3307 ;;
3308 @(rdiff|patch))
3309 mode=rdiff
3310 ;;
3311 @(remove|rm|delete))
3312 mode=remove
3313 ;;
3314 @(rtag|rfreeze))
3315 mode=rtag
3316 ;;
3317 st?(at?(us)))
3318 mode=status
3319 ;;
3320 @(tag|freeze))
3321 mode=tag
3322 ;;
3323 up?(d?(ate)))
3324 mode=update
3325 ;;
3326 *)
3327
3328 ;;
3329 esac;
3330 else
3331 if [[ "$i" = -* ]]; then
3332 flags=("${flags[@]}" $i);
3333 fi;
3334 fi;
3335 count=$((++count));
3336 done;
3337 case "$mode" in
3338 add)
3339 if [[ "$cur" != -* ]]; then
3340 set_prefix;
3341 if [ $COMP_CWORD -gt 1 -a -r ${prefix:-}CVS/Entries ]; then
3342 get_entries;
3343 [ -z "$cur" ] && files=$( command ls -Ad !(CVS) ) || files=$( command ls -d ${cur}* 2>/dev/null );
3344 for i in "${entries[@]}";
3345 do
3346 files=(${files[@]/#$i//});
3347 done;
3348 COMPREPLY=($( compgen -X '*~' -W '${files[@]}' -- $cur ));
3349 fi;
3350 else
3351 COMPREPLY=($( compgen -W '-k -m' -- $cur ));
3352 fi
3353 ;;
3354 admin)
3355 if [[ "$cur" = -* ]]; then
3356 COMPREPLY=($( compgen -W '-i -a -A -e -b -c -k -l -u \
3357 -L -U -m -M -n -N -o -q -I \
3358 -s -t -t- -T -V -x -z' -- $cur ));
3359 fi
3360 ;;
3361 annotate)
3362 if [[ "$cur" = -* ]]; then
3363 COMPREPLY=($( compgen -W '-D -F -f -l -R -r' -- $cur ));
3364 else
3365 get_entries;
3366 COMPREPLY=($( compgen -W '${entries[@]}' -- $cur ));
3367 fi
3368 ;;
3369 checkout)
3370 if [[ "$cur" != -* ]]; then
3371 [ -z "$cvsroot" ] && cvsroot=$CVSROOT;
3372 COMPREPLY=($( cvs -d "$cvsroot" co -c 2> /dev/null | awk '{print $1}' ));
3373 COMPREPLY=($( compgen -W '${COMPREPLY[@]}' -- $cur ));
3374 else
3375 COMPREPLY=($( compgen -W '-A -N -P -R -c -f -l -n -p \
3376 -s -r -D -d -k -j' -- $cur ));
3377 fi
3378 ;;
3379 commit)
3380 set_prefix;
3381 if [[ "$cur" != -* ]] && [ -r ${prefix:-}CVS/Entries ]; then
3382 if [ -n "${COMP_CVS_REMOTE:-}" ]; then
3383 changed=($( cvs -q diff --brief 2>&1 | sed -ne 's/^Files [^ ]* and \([^ ]*\) differ$/\1/p' ));
3384 newremoved=($( cvs -q diff --brief 2>&1 | sed -ne 's/^cvs diff: \([^ ]*\) .*, no comparison available$/\1/p' ));
3385 COMPREPLY=($( compgen -W '${changed[@]:-} \
3386 ${newremoved[@]:-}' -- $cur ));
3387 else
3388 COMPREPLY=($(compgen $default -- "$cur"));
3389 fi;
3390 else
3391 COMPREPLY=($( compgen -W '-n -R -l -f -F -m -r' -- $cur ));
3392 fi
3393 ;;
3394 cvsroot)
3395 if [ -r ~/.cvspass ]; then
3396 cvsroots=$( sed 's/^[^ ]* //; s/:/\\:/g' ~/.cvspass );
3397 COMPREPLY=($( compgen -W '$cvsroots' -- $cur ));
3398 fi
3399 ;;
3400 export)
3401 if [[ "$cur" != -* ]]; then
3402 [ -z "$cvsroot" ] && cvsroot=$CVSROOT;
3403 COMPREPLY=($( cvs -d "$cvsroot" co -c | awk '{print $1}' ));
3404 COMPREPLY=($( compgen -W '${COMPREPLY[@]}' -- $cur ));
3405 else
3406 COMPREPLY=($( compgen -W '-N -f -l -R -n \
3407 -r -D -d -k' -- $cur ));
3408 fi
3409 ;;
3410 diff)
3411 if [[ "$cur" == -* ]]; then
3412 _longopt diff;
3413 else
3414 get_entries;
3415 COMPREPLY=($( compgen -W '${entries[@]:-}' -- $cur ));
3416 fi
3417 ;;
3418 remove)
3419 if [[ "$cur" != -* ]]; then
3420 set_prefix;
3421 if [ $COMP_CWORD -gt 1 -a -r ${prefix:-}CVS/Entries ]; then
3422 get_entries;
3423 for i in "${entries[@]}";
3424 do
3425 [ ! -r "$i" ] && miss=("${miss[@]}" $i);
3426 done;
3427 COMPREPLY=($(compgen -W '${miss[@]:-}' -- $cur));
3428 fi;
3429 else
3430 COMPREPLY=($( compgen -W '-f -l -R' -- $cur ));
3431 fi
3432 ;;
3433 import)
3434 if [[ "$cur" != -* ]]; then
3435 [ -z "$cvsroot" ] && cvsroot=$CVSROOT;
3436 prefix=${cur%/*};
3437 if [ -r ${cvsroot}/${prefix} ]; then
3438 get_modules;
3439 COMPREPLY=(${COMPREPLY[@]#$cvsroot});
3440 COMPREPLY=(${COMPREPLY[@]#\/});
3441 fi;
3442 pwd=$( pwd );
3443 pwd=${pwd##*/};
3444 COMPREPLY=($( compgen -W '${COMPREPLY[@]} $pwd' -- $cur ));
3445 else
3446 COMPREPLY=($( compgen -W '-d -k -I -b -m -W' -- $cur ));
3447 fi
3448 ;;
3449 update)
3450 if [[ "$cur" = -* ]]; then
3451 COMPREPLY=($( compgen -W '-A -P -C -d -f -l -R -p \
3452 -k -r -D -j -I -W' -- $cur ));
3453 fi
3454 ;;
3455 "")
3456 COMPREPLY=($( compgen -W 'add admin annotate checkout ci co \
3457 commit diff delete edit export \
3458 freeze get history import log new \
3459 patch rcs rdiff release remove \
3460 rfreeze rlog rm rtag stat status \
3461 tag unedit up update -H -Q -q -b \
3462 -d -e -f -l -n -t -r -v -w -x -z \
3463 --help --version' -- $cur ))
3464 ;;
3465 *)
3466
3467 ;;
3468 esac;
3469 return 0
3470}
3471_dd ()
3472{
3473 local cur;
3474 COMPREPLY=();
3475 cur=`_get_cword`;
3476 case "$cur" in
3477 if=* | of=*)
3478 cur=${cur#*=};
3479 _filedir;
3480 return 0
3481 ;;
3482 conv=*)
3483 cur=${cur#*=};
3484 COMPREPLY=($( compgen -W 'ascii ebcdic ibm block unblock \
3485 lcase notrunc ucase swab noerror sync' -- $cur ));
3486 return 0
3487 ;;
3488 esac;
3489 _expand || return 0;
3490 COMPREPLY=($( compgen -W '--help --version' -- $cur ) $( compgen -W 'bs cbs conv count ibs if obs of seek skip' -S '=' -- $cur ))
3491}
3492_debconf_show ()
3493{
3494 local cur;
3495 COMPREPLY=();
3496 cur=${COMP_WORDS[COMP_CWORD]};
3497 COMPREPLY=($( compgen -W '--listowners --listdbs --db=' -- $cur ) $( apt-cache pkgnames -- $cur ))
3498}
3499_dhclient ()
3500{
3501 local cur prev;
3502 COMPREPLY=();
3503 cur=`_get_cword`;
3504 prev=${COMP_WORDS[COMP_CWORD-1]};
3505 case "$prev" in
3506 -@(cf|lf|pf|sf))
3507 _filedir;
3508 return 0
3509 ;;
3510 -s)
3511 _known_hosts;
3512 return 0
3513 ;;
3514 esac;
3515 if [[ "$cur" == -* ]]; then
3516 COMPREPLY=($( compgen -W '-p -d -q -1 -r -lf -pf \
3517 -cf -sf -s -g -n -nw -w' -- $cur ));
3518 else
3519 _available_interfaces;
3520 fi
3521}
3522_dnsspoof ()
3523{
3524 local cur;
3525 COMPREPLY=();
3526 cur=`_get_cword`;
3527 prev=${COMP_WORDS[COMP_CWORD-1]};
3528 case "$prev" in
3529 -i)
3530 _interfaces;
3531 return 0
3532 ;;
3533 -f)
3534 _filedir;
3535 return 0
3536 ;;
3537 esac;
3538 if [[ "$cur" == -* ]]; then
3539 COMPREPLY=($( compgen -W '-i -f' -- $cur ));
3540 fi
3541}
3542_dpkg ()
3543{
3544 local cur prev i;
3545 COMPREPLY=();
3546 cur=`_get_cword`;
3547 prev=${COMP_WORDS[COMP_CWORD-1]};
3548 i=$COMP_CWORD;
3549 _expand || return 0;
3550 if [[ $cur != -* ]]; then
3551 while [[ $prev != -* && $i != 1 ]]; do
3552 i=$((i-1));
3553 prev=${COMP_WORDS[i-1]};
3554 done;
3555 fi;
3556 case "$prev" in
3557 -@(c|i|A|I|f|e|x|X|-@(install|unpack|record-avail|contents|info|fsys-tarfile|field|control|extract)))
3558 _filedir '?(u)deb';
3559 return 0
3560 ;;
3561 -@(b|-build))
3562 _filedir -d;
3563 return 0
3564 ;;
3565 -@(s|p|l|-@(status|print-avail|list)))
3566 COMPREPLY=($( apt-cache pkgnames $cur 2>/dev/null ));
3567 return 0
3568 ;;
3569 -@(S|-search))
3570 _filedir;
3571 return 0
3572 ;;
3573 -@(r|L|P|-@(remove|purge|listfiles)))
3574 COMPREPLY=($( _comp_dpkg_installed_packages $cur ));
3575 return 0
3576 ;;
3577 *)
3578 COMPREPLY=($( compgen -W '-i --install --unpack -A --record-avail \
3579 --configure -r --remove -P --purge --get-selections \
3580 --set-selections --update-avail --merge-avail \
3581 --clear-avail --command-fd --forget-old-unavail -s \
3582 --status -p --print-avail -L --listfiles -l --list \
3583 -S --search -C --audit --print-architecture \
3584 --print-gnu-build-architecture \
3585 --print-installation-architecture \
3586 --compare-versions --help --version --force-help \
3587 --force-all --force-auto-select --force-downgrade \
3588 --force-configure-any --force-hold --force-bad-path \
3589 --force-not-root --force-overwrite \
3590 --force-overwrite-diverted --force-bad-verify \
3591 --force-depends-version --force-depends \
3592 --force-confnew --force-confold --force-confdef \
3593 --force-confmiss --force-conflicts --force-architecture\
3594 --force-overwrite-dir --force-remove-reinstreq \
3595 --force-remove-essential -Dh \
3596 --debug=help --licence --admindir= --root= --instdir= \
3597 -O --selected-only -E --skip-same-version \
3598 -G --refuse-downgrade -B --auto-deconfigure \
3599 --no-debsig --no-act -D --debug= --status-fd \
3600 -b --build -I --info -f --field -c --contents \
3601 -x --extract -X --vextract --fsys-tarfile -e --control \
3602 --ignore-depends= --abort-after' -- $cur ))
3603 ;;
3604 esac
3605}
3606_dpkg_reconfigure ()
3607{
3608 local cur prev opt;
3609 COMPREPLY=();
3610 cur=`_get_cword`;
3611 prev=${COMP_WORDS[COMP_CWORD-1]};
3612 case "$prev" in
3613 -@(f|-frontend))
3614 opt=($( echo /usr/share/perl5/Debconf/FrontEnd/* ));
3615 opt=(${opt[@]##*/});
3616 opt=(${opt[@]%.pm});
3617 COMPREPLY=($( compgen -W '${opt[@]}' -- $cur ));
3618 return 0
3619 ;;
3620 -@(p|-priority))
3621 COMPREPLY=($( compgen -W 'low medium high critical' -- $cur ));
3622 return 0
3623 ;;
3624 esac;
3625 if [[ "$cur" == -* ]]; then
3626 COMPREPLY=($( compgen -W '-f --frontend -p --priority -a --all \
3627 -u --unseen-only -h --help -s --showold \
3628 --force --terse' -- $cur ));
3629 else
3630 COMPREPLY=($( _comp_dpkg_installed_packages $cur ));
3631 fi
3632}
3633_dpkg_source ()
3634{
3635 local cur prev options work i action packopts unpackopts;
3636 packopts="-c -l -F -V -T -D -U -W -E -sa -i -I -sk -sp -su -sr -ss -sn -sA -sK -sP -sU -sR";
3637 unpackopts="-sp -sn -su";
3638 options=`echo "-x -b $packopts $unpackopts" | xargs echo | sort -u | xargs echo`;
3639 COMPREPLY=();
3640 if [ "$1" != "dpkg-source" ]; then
3641 return 1;
3642 fi;
3643 cur=`_get_cword`;
3644 prev=${COMP_WORDS[COMP_CWORD-1]};
3645 action="options";
3646 for ((i=0; i < ${#COMP_WORDS[@]}-1; i++ ))
3647 do
3648 if [[ ${COMP_WORDS[$i]} == "-x" ]]; then
3649 action=unpack;
3650 else
3651 if [[ ${COMP_WORDS[$i]} == "-b" ]]; then
3652 action=pack;
3653 else
3654 if [[ ${COMP_WORDS[$i]} == "-h" ]]; then
3655 action=help;
3656 fi;
3657 fi;
3658 fi;
3659 done;
3660 for i in $options;
3661 do
3662 if [ "$cur" = "$i" ]; then
3663 COMPREPLY=("$cur");
3664 return 0;
3665 fi;
3666 done;
3667 case "$action" in
3668 "unpack")
3669 if [ "$cur" = "-" -o "$cur" = "-s" ]; then
3670 COMPREPLY=($unpackopts);
3671 return 0;
3672 fi;
3673 case "$prev" in
3674 "-x")
3675 COMPREPLY=($( compgen -d -- "$cur" ) $( compgen -f -X '!*.dsc' -- "$cur" ));
3676 return 0
3677 ;;
3678 *)
3679 COMPREPLY=($unpackopts $(compgen -d -f -- "$cur" ));
3680 return 0
3681 ;;
3682 esac;
3683 return 0
3684 ;;
3685 "pack")
3686 if [ "$cur" = "-" ]; then
3687 COMPREPLY=($packopts);
3688 return 0;
3689 fi;
3690 if [ "$cur" = "-s" ]; then
3691 COMPREPLY=("-sa" "-sk" "-sp" "-su" "-sr" "-ss" "-sn" "-sA" "-sK" "-sP" "-sU" "-sR");
3692 return 0;
3693 fi;
3694 case "$prev" in
3695 "-b")
3696 COMPREPLY=($( compgen -d -- "$cur" ));
3697 return 0
3698 ;;
3699 "-c" | "-l" | "-T" | "-i" | "-I")
3700 COMPREPLY=($( compgen -d -f ));
3701 return 0
3702 ;;
3703 "-F")
3704 COMPREPLY=($( ( cd /usr/lib/dpkg/parsechangelog; compgen -f "$cur" ) ));
3705 return 0
3706 ;;
3707 "-V" | "-D")
3708 COMPREPLY=();
3709 return 0
3710 ;;
3711 "-D")
3712 if echo -- "$cur" | grep --color=auto -q "="; then
3713 COMPREPLY=();
3714 return 0;
3715 else
3716 COMPREPLY=(Format Source Version Binary Maintainer Uploader Architecture Standards-Version Build-Depends Files);
3717 return 0;
3718 fi
3719 ;;
3720 "-U")
3721 COMPREPLY=(Format Source Version Binary Maintainer Uploader Architecture Standards-Version Build-Depends Files);
3722 return 0
3723 ;;
3724 *)
3725 COMPREPLY=($packopts);
3726 return 0
3727 ;;
3728 esac;
3729 return 0
3730 ;;
3731 *)
3732 if [ "$cur" = "-s" ]; then
3733 COMPREPLY=("-sa" "-sk" "-sp" "-su" "-sr" "-ss" "-sn" "-sA" "-sK" "-sP" "-sU" "-sR");
3734 return 0;
3735 fi;
3736 COMPREPLY=($options);
3737 return 0
3738 ;;
3739 esac
3740}
3741_dsniff ()
3742{
3743 local cur;
3744 COMPREPLY=();
3745 cur=`_get_cword`;
3746 prev=${COMP_WORDS[COMP_CWORD-1]};
3747 case "$prev" in
3748 -@(r|w|f))
3749 _filedir;
3750 return 0
3751 ;;
3752 -i)
3753 _interfaces;
3754 return 0
3755 ;;
3756 esac;
3757 if [[ "$cur" == -* ]]; then
3758 COMPREPLY=($( compgen -W '-c -d -m -n -i -s -f -t \
3759 -r -w' -- $cur ));
3760 fi
3761}
3762_dumpdb ()
3763{
3764 local cur;
3765 COMPREPLY=();
3766 cur=`_get_cword`;
3767 if [[ "$cur" == -* ]]; then
3768 COMPREPLY=($( compgen -W '--marshal -m --pickle -p --noprint -n -h --help' -- $cur ));
3769 else
3770 _filedir;
3771 fi
3772}
3773_expand ()
3774{
3775 if [[ "$cur" == \~*/* ]]; then
3776 eval cur=$cur;
3777 else
3778 if [[ "$cur" == \~* ]]; then
3779 cur=${cur#\~};
3780 COMPREPLY=($( compgen -P '~' -u $cur ));
3781 [ ${#COMPREPLY[@]} -eq 1 ] && eval COMPREPLY[0]=${COMPREPLY[0]};
3782 return ${#COMPREPLY[@]};
3783 fi;
3784 fi
3785}
3786_export ()
3787{
3788 local cur;
3789 COMPREPLY=();
3790 cur=`_get_cword`;
3791 case "$COMP_LINE" in
3792 *=\$*)
3793 COMPREPLY=($( compgen -v -P '$' -- ${cur#*=\$} ))
3794 ;;
3795 *[^=])
3796 COMPREPLY=($( compgen -v -S '=' -- $cur ))
3797 ;;
3798 *=)
3799 COMPREPLY=("$( eval echo -n \"$`echo ${cur%=}`\" |
3800 ( echo -n \'
3801 sed -e 's/'\''/'\''\\\'\'''\''/g'
3802 echo -n \' ) )")
3803 ;;
3804 esac
3805}
3806_filedir ()
3807{
3808 local IFS='
3809' xspec;
3810 _expand || return 0;
3811 local -a toks;
3812 local tmp;
3813 toks=(${toks[@]-} $(
3814 compgen -d -- "$(quote_readline "$cur")" | {
3815 while read -r tmp; do
3816 echo $tmp
3817 done
3818 }
3819 ));
3820 if [[ "$1" != -d ]]; then
3821 xspec=${1:+"!*.$1"};
3822 toks=(${toks[@]-} $(
3823 compgen -f -X "$xspec" -- "$(quote_readline "$cur")" | {
3824 while read -r tmp; do
3825 [ -n $tmp ] && echo $tmp
3826 done
3827 }
3828 ));
3829 fi;
3830 COMPREPLY=("${COMPREPLY[@]}" "${toks[@]}")
3831}
3832_filedir_xspec ()
3833{
3834 local IFS cur xspec;
3835 IFS='
3836';
3837 COMPREPLY=();
3838 cur=`_get_cword`;
3839 _expand || return 0;
3840 xspec=$( sed -ne '/^complete .*[ ]'${1##*/}'\([ ]\|$\)/{p;q;}' $BASH_COMPLETION );
3841 xspec=${xspec#*-X };
3842 xspec=${xspec%% *};
3843 local -a toks;
3844 local tmp;
3845 toks=(${toks[@]-} $(
3846 compgen -d -- "$(quote_readline "$cur")" | {
3847 while read -r tmp; do
3848 # see long TODO comment in _filedir() --David
3849 echo $tmp
3850 done
3851 }
3852 ));
3853 toks=(${toks[@]-} $(
3854 eval compgen -f -X "$xspec" -- "\$(quote_readline "\$cur")" | {
3855 while read -r tmp; do
3856 [ -n $tmp ] && echo $tmp
3857 done
3858 }
3859 ));
3860 COMPREPLY=("${toks[@]}")
3861}
3862_find ()
3863{
3864 local cur prev i exprfound onlyonce;
3865 COMPREPLY=();
3866 cur=`_get_cword`;
3867 prev=${COMP_WORDS[COMP_CWORD-1]};
3868 case "$prev" in
3869 -@(max|min)depth)
3870 COMPREPLY=($( compgen -W '0 1 2 3 4 5 6 7 8 9' -- $cur ));
3871 return 0
3872 ;;
3873 -?(a|c)newer | -fls | -fprint?(0|f) | -?(i)?(l)name | -?(i)wholename)
3874 _filedir;
3875 return 0
3876 ;;
3877 -fstype)
3878 [ -e /proc/filesystems ] && COMPREPLY=($( cut -d' ' -f 2 /proc/filesystems | grep "^$cur" ));
3879 return 0
3880 ;;
3881 -gid)
3882 _gids;
3883 return 0
3884 ;;
3885 -group)
3886 if [ -n "$bash205" ]; then
3887 COMPREPLY=($( compgen -g -- $cur 2>/dev/null));
3888 fi;
3889 return 0
3890 ;;
3891 -?(x)type)
3892 COMPREPLY=($( compgen -W 'b c d p f l s' -- $cur ));
3893 return 0
3894 ;;
3895 -uid)
3896 _uids;
3897 return 0
3898 ;;
3899 -user)
3900 COMPREPLY=($( compgen -u -- $cur ));
3901 return 0
3902 ;;
3903 -exec | -ok)
3904 COMP_WORDS=(COMP_WORDS[0] $cur);
3905 COMP_CWORD=1;
3906 _command;
3907 return 0
3908 ;;
3909 -[acm]min | -[acm]time | -?(i)?(l)?(whole)name | -inum | -?(i)path | -?(i)regex | -links | -perm | -size | -used | -printf)
3910 return 0
3911 ;;
3912 esac;
3913 _expand || return 0;
3914 for i in ${COMP_WORDS[@]};
3915 do
3916 [[ "$i" = [-\(\),\!]* ]] && exprfound=1 && break;
3917 done;
3918 if [ "$exprfound" != 1 ] && [[ "$cur" != [-\(\),\!]* ]]; then
3919 _filedir -d;
3920 return 0;
3921 fi;
3922 COMPREPLY=($( compgen -W '-daystart -depth -follow -help -maxdepth \
3923 -mindepth -mount -noleaf -version -xdev -amin -anewer \
3924 -atime -cmin -cnewer -ctime -empty -false -fstype \
3925 -gid -group -ilname -iname -inum -ipath -iregex \
3926 -wholename \
3927 -links -lname -mmin -mtime -name -newer -nouser \
3928 -nogroup -perm -regex -size -true -type -uid -used \
3929 -user -xtype -exec -fls -fprint -fprint0 -fprintf -ok \
3930 -print -print0 -printf -prune -ls -wholename -iwholename' -- $cur ));
3931 onlyonce=' -daystart -depth -follow -help -maxdepth -mindepth -mount \
3932 -noleaf -version -xdev ';
3933 COMPREPLY=($( echo "${COMP_WORDS[@]}" | (while read -d ' ' i; do
3934 [ "$i" == "" ] ||
3935 [ "${onlyonce/ ${i%% *} / }" == "$onlyonce" ] &&
3936 continue
3937 # flatten array with spaces on either side,
3938 # otherwise we cannot grep on word boundaries of
3939 # first and last word
3940 COMPREPLY=" ${COMPREPLY[@]} "
3941 # remove word from list of completions
3942 COMPREPLY=( ${COMPREPLY/ ${i%% *} / } )
3943 done
3944 echo "${COMPREPLY[@]}")
3945 ));
3946 _filedir;
3947 return 0
3948}
3949_find_member ()
3950{
3951 local cur prev;
3952 COMPREPLY=();
3953 cur=`_get_cword`;
3954 prev=${COMP_WORDS[COMP_CWORD-1]};
3955 case "$prev" in
3956 -@(l|x|-listname=|-exclude=))
3957 _mailman_lists;
3958 return 0
3959 ;;
3960 esac;
3961 if [[ "$cur" == -* ]]; then
3962 COMPREPLY=($( compgen -W '-l --listname= -x \
3963 --exclude= --owners -w --help -h' -- $cur ));
3964 fi
3965}
3966_function ()
3967{
3968 local cur prev;
3969 COMPREPLY=();
3970 cur=`_get_cword`;
3971 prev=${COMP_WORDS[COMP_CWORD-1]};
3972 if [[ $1 == @(declare|typeset) ]]; then
3973 if [ "$prev" = -f ]; then
3974 COMPREPLY=($( compgen -A function -- $cur ));
3975 else
3976 if [[ "$cur" == -* ]]; then
3977 COMPREPLY=($( compgen -W '-a -f -F -i -r -x -p' -- $cur ));
3978 fi;
3979 fi;
3980 else
3981 if [ $COMP_CWORD -eq 1 ]; then
3982 COMPREPLY=($( compgen -A function -- $cur ));
3983 else
3984 COMPREPLY=("() $( type -- ${COMP_WORDS[1]} | sed -e 1,2d )");
3985 fi;
3986 fi
3987}
3988_gcc ()
3989{
3990 local cur cc backend;
3991 COMPREPLY=();
3992 cur=`_get_cword`;
3993 _expand || return 0;
3994 case "$1" in
3995 gcj)
3996 backend=jc1
3997 ;;
3998 gpc)
3999 backend=gpc1
4000 ;;
4001 *77)
4002 backend=f771
4003 ;;
4004 *)
4005 backend=cc1
4006 ;;
4007 esac;
4008 if [[ "$cur" == -* ]]; then
4009 cc=$( $1 -print-prog-name=$backend );
4010 COMPREPLY=($( $cc --help 2>/dev/null | tr '\t' ' ' | sed -e '/^ *-/!d' -e 's/ *-\([^ ]*\).*/-\1/' | command grep "^$cur" | sort -u ));
4011 else
4012 _filedir;
4013 fi
4014}
4015_gcl ()
4016{
4017 local cur;
4018 COMPREPLY=();
4019 cur=`_get_cword`;
4020 if [[ "$cur" == -* ]]; then
4021 COMPREPLY=($( compgen -W '-eval -load -f -batch -dir -libdir \
4022 -compile -o-file -c-file -h-file -data-file -system-p ' -- $cur ));
4023 else
4024 _filedir;
4025 fi;
4026 return 0
4027}
4028_genaliases ()
4029{
4030 local cur;
4031 COMPREPLY=();
4032 cur=`_get_cword`;
4033 if [[ "$cur" == -* ]]; then
4034 COMPREPLY=($( compgen -W '-q --quiet -h --help' -- $cur ));
4035 fi
4036}
4037_get_cword ()
4038{
4039 if [[ "${#COMP_WORDS[COMP_CWORD]}" -eq 0 ]] || [[ "$COMP_POINT" == "${#COMP_LINE}" ]]; then
4040 printf "%s" "${COMP_WORDS[COMP_CWORD]}";
4041 else
4042 local i;
4043 local cur="$COMP_LINE";
4044 local index="$COMP_POINT";
4045 for ((i = 0; i <= COMP_CWORD; ++i ))
4046 do
4047 while [[ "${#cur}" -ge ${#COMP_WORDS[i]} ]] && [[ "${cur:0:${#COMP_WORDS[i]}}" != "${COMP_WORDS[i]}" ]]; do
4048 cur="${cur:1}";
4049 index="$(( index - 1 ))";
4050 done;
4051 if [[ "$i" -lt "$COMP_CWORD" ]]; then
4052 local old_size="${#cur}";
4053 cur="${cur#${COMP_WORDS[i]}}";
4054 local new_size="${#cur}";
4055 index="$(( index - old_size + new_size ))";
4056 fi;
4057 done;
4058 if [[ "${COMP_WORDS[COMP_CWORD]:0:${#cur}}" != "$cur" ]]; then
4059 printf "%s" "${COMP_WORDS[COMP_CWORD]}";
4060 else
4061 printf "%s" "${cur:0:$index}";
4062 fi;
4063 fi
4064}
4065_getent ()
4066{
4067 local cur prev;
4068 COMPREPLY=();
4069 cur=`_get_cword`;
4070 prev=${COMP_WORDS[COMP_CWORD-1]};
4071 case $prev in
4072 passwd)
4073 COMPREPLY=($( compgen -u $cur ));
4074 return 0
4075 ;;
4076 group)
4077 COMPREPLY=($( compgen -g $cur ));
4078 return 0
4079 ;;
4080 services)
4081 COMPREPLY=($( compgen -s $cur ));
4082 return 0
4083 ;;
4084 hosts)
4085 COMPREPLY=($( compgen -A hostname $cur ));
4086 return 0
4087 ;;
4088 protocols | networks | ahosts | ahostsv4 | ahostsv6 | rpc)
4089 COMPREPLY=($( getent $prev | sed -ne 's|^\('$cur'[^[:space:]]*\).*|\1|p' ));
4090 return 0
4091 ;;
4092 aliases | shadow)
4093 COMPREPLY=($( getent $prev | sed -ne 's|^\('$cur'[^:]*\).*|\1|p' ));
4094 return 0
4095 ;;
4096 esac;
4097 if [ $COMP_CWORD -eq 1 ]; then
4098 COMPREPLY=($( compgen -W 'passwd group hosts services \
4099 protocols networks ahosts ahostsv4 \
4100 ahostsv6 aliases ethers netgroup \
4101 rpc shadow' -- $cur ));
4102 fi
4103}
4104_gids ()
4105{
4106 if type getent &>/dev/null; then
4107 COMPREPLY=($( getent group | awk -F: '{if ($3 ~ /^'$cur'/) print $3}' ));
4108 else
4109 if type perl &>/dev/null; then
4110 COMPREPLY=($( compgen -W '$( perl -e '"'"'while (($gid) = (getgrent)[2]) { print $gid . "\n" }'"'"' )' -- $cur ));
4111 else
4112 COMPREPLY=($( awk 'BEGIN {FS=":"} {if ($3 ~ /^'$cur'/) print $3}' /etc/group ));
4113 fi;
4114 fi
4115}
4116_git ()
4117{
4118 local i c=1 command __git_dir;
4119 while [ $c -lt $COMP_CWORD ]; do
4120 i="${COMP_WORDS[c]}";
4121 case "$i" in
4122 --git-dir=*)
4123 __git_dir="${i#--git-dir=}"
4124 ;;
4125 --bare)
4126 __git_dir="."
4127 ;;
4128 --version | -p | --paginate)
4129
4130 ;;
4131 --help)
4132 command="help";
4133 break
4134 ;;
4135 *)
4136 command="$i";
4137 break
4138 ;;
4139 esac;
4140 c=$((++c));
4141 done;
4142 if [ -z "$command" ]; then
4143 case "${COMP_WORDS[COMP_CWORD]}" in
4144 --*)
4145 __gitcomp "
4146 --paginate
4147 --no-pager
4148 --git-dir=
4149 --bare
4150 --version
4151 --exec-path
4152 --html-path
4153 --work-tree=
4154 --help
4155 "
4156 ;;
4157 *)
4158 __gitcomp "$(__git_porcelain_commands) $(__git_aliases)"
4159 ;;
4160 esac;
4161 return;
4162 fi;
4163 local expansion=$(__git_aliased_command "$command");
4164 [ "$expansion" ] && command="$expansion";
4165 case "$command" in
4166 am)
4167 _git_am
4168 ;;
4169 add)
4170 _git_add
4171 ;;
4172 apply)
4173 _git_apply
4174 ;;
4175 archive)
4176 _git_archive
4177 ;;
4178 bisect)
4179 _git_bisect
4180 ;;
4181 bundle)
4182 _git_bundle
4183 ;;
4184 branch)
4185 _git_branch
4186 ;;
4187 checkout)
4188 _git_checkout
4189 ;;
4190 cherry)
4191 _git_cherry
4192 ;;
4193 cherry-pick)
4194 _git_cherry_pick
4195 ;;
4196 clean)
4197 _git_clean
4198 ;;
4199 clone)
4200 _git_clone
4201 ;;
4202 commit)
4203 _git_commit
4204 ;;
4205 config)
4206 _git_config
4207 ;;
4208 describe)
4209 _git_describe
4210 ;;
4211 diff)
4212 _git_diff
4213 ;;
4214 difftool)
4215 _git_difftool
4216 ;;
4217 fetch)
4218 _git_fetch
4219 ;;
4220 format-patch)
4221 _git_format_patch
4222 ;;
4223 fsck)
4224 _git_fsck
4225 ;;
4226 gc)
4227 _git_gc
4228 ;;
4229 grep)
4230 _git_grep
4231 ;;
4232 help)
4233 _git_help
4234 ;;
4235 init)
4236 _git_init
4237 ;;
4238 log)
4239 _git_log
4240 ;;
4241 ls-files)
4242 _git_ls_files
4243 ;;
4244 ls-remote)
4245 _git_ls_remote
4246 ;;
4247 ls-tree)
4248 _git_ls_tree
4249 ;;
4250 merge)
4251 _git_merge
4252 ;;
4253 mergetool)
4254 _git_mergetool
4255 ;;
4256 merge-base)
4257 _git_merge_base
4258 ;;
4259 mv)
4260 _git_mv
4261 ;;
4262 name-rev)
4263 _git_name_rev
4264 ;;
4265 pull)
4266 _git_pull
4267 ;;
4268 push)
4269 _git_push
4270 ;;
4271 rebase)
4272 _git_rebase
4273 ;;
4274 remote)
4275 _git_remote
4276 ;;
4277 reset)
4278 _git_reset
4279 ;;
4280 revert)
4281 _git_revert
4282 ;;
4283 rm)
4284 _git_rm
4285 ;;
4286 send-email)
4287 _git_send_email
4288 ;;
4289 shortlog)
4290 _git_shortlog
4291 ;;
4292 show)
4293 _git_show
4294 ;;
4295 show-branch)
4296 _git_show_branch
4297 ;;
4298 stash)
4299 _git_stash
4300 ;;
4301 stage)
4302 _git_add
4303 ;;
4304 submodule)
4305 _git_submodule
4306 ;;
4307 svn)
4308 _git_svn
4309 ;;
4310 tag)
4311 _git_tag
4312 ;;
4313 whatchanged)
4314 _git_log
4315 ;;
4316 *)
4317 COMPREPLY=()
4318 ;;
4319 esac
4320}
4321_git_add ()
4322{
4323 __git_has_doubledash && return;
4324 local cur="${COMP_WORDS[COMP_CWORD]}";
4325 case "$cur" in
4326 --*)
4327 __gitcomp "
4328 --interactive --refresh --patch --update --dry-run
4329 --ignore-errors --intent-to-add
4330 ";
4331 return
4332 ;;
4333 esac;
4334 COMPREPLY=()
4335}
4336_git_am ()
4337{
4338 local cur="${COMP_WORDS[COMP_CWORD]}" dir="$(__gitdir)";
4339 if [ -d "$dir"/rebase-apply ]; then
4340 __gitcomp "--skip --resolved --abort";
4341 return;
4342 fi;
4343 case "$cur" in
4344 --whitespace=*)
4345 __gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}";
4346 return
4347 ;;
4348 --*)
4349 __gitcomp "
4350 --3way --committer-date-is-author-date --ignore-date
4351 --interactive --keep --no-utf8 --signoff --utf8
4352 --whitespace=
4353 ";
4354 return
4355 ;;
4356 esac;
4357 COMPREPLY=()
4358}
4359_git_apply ()
4360{
4361 local cur="${COMP_WORDS[COMP_CWORD]}";
4362 case "$cur" in
4363 --whitespace=*)
4364 __gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}";
4365 return
4366 ;;
4367 --*)
4368 __gitcomp "
4369 --stat --numstat --summary --check --index
4370 --cached --index-info --reverse --reject --unidiff-zero
4371 --apply --no-add --exclude=
4372 --whitespace= --inaccurate-eof --verbose
4373 ";
4374 return
4375 ;;
4376 esac;
4377 COMPREPLY=()
4378}
4379_git_archive ()
4380{
4381 local cur="${COMP_WORDS[COMP_CWORD]}";
4382 case "$cur" in
4383 --format=*)
4384 __gitcomp "$(git archive --list)" "" "${cur##--format=}";
4385 return
4386 ;;
4387 --remote=*)
4388 __gitcomp "$(__git_remotes)" "" "${cur##--remote=}";
4389 return
4390 ;;
4391 --*)
4392 __gitcomp "
4393 --format= --list --verbose
4394 --prefix= --remote= --exec=
4395 ";
4396 return
4397 ;;
4398 esac;
4399 __git_complete_file
4400}
4401_git_bisect ()
4402{
4403 __git_has_doubledash && return;
4404 local subcommands="start bad good skip reset visualize replay log run";
4405 local subcommand="$(__git_find_subcommand "$subcommands")";
4406 if [ -z "$subcommand" ]; then
4407 __gitcomp "$subcommands";
4408 return;
4409 fi;
4410 case "$subcommand" in
4411 bad | good | reset | skip)
4412 __gitcomp "$(__git_refs)"
4413 ;;
4414 *)
4415 COMPREPLY=()
4416 ;;
4417 esac
4418}
4419_git_branch ()
4420{
4421 local i c=1 only_local_ref="n" has_r="n";
4422 while [ $c -lt $COMP_CWORD ]; do
4423 i="${COMP_WORDS[c]}";
4424 case "$i" in
4425 -d | -m)
4426 only_local_ref="y"
4427 ;;
4428 -r)
4429 has_r="y"
4430 ;;
4431 esac;
4432 c=$((++c));
4433 done;
4434 case "${COMP_WORDS[COMP_CWORD]}" in
4435 --*)
4436 __gitcomp "
4437 --color --no-color --verbose --abbrev= --no-abbrev
4438 --track --no-track --contains --merged --no-merged
4439 "
4440 ;;
4441 *)
4442 if [ $only_local_ref = "y" -a $has_r = "n" ]; then
4443 __gitcomp "$(__git_heads)";
4444 else
4445 __gitcomp "$(__git_refs)";
4446 fi
4447 ;;
4448 esac
4449}
4450_git_bundle ()
4451{
4452 local cmd="${COMP_WORDS[2]}";
4453 case "$COMP_CWORD" in
4454 2)
4455 __gitcomp "create list-heads verify unbundle"
4456 ;;
4457 3)
4458
4459 ;;
4460 *)
4461 case "$cmd" in
4462 create)
4463 __git_complete_revlist
4464 ;;
4465 esac
4466 ;;
4467 esac
4468}
4469_git_checkout ()
4470{
4471 __git_has_doubledash && return;
4472 __gitcomp "$(__git_refs)"
4473}
4474_git_cherry ()
4475{
4476 __gitcomp "$(__git_refs)"
4477}
4478_git_cherry_pick ()
4479{
4480 local cur="${COMP_WORDS[COMP_CWORD]}";
4481 case "$cur" in
4482 --*)
4483 __gitcomp "--edit --no-commit"
4484 ;;
4485 *)
4486 __gitcomp "$(__git_refs)"
4487 ;;
4488 esac
4489}
4490_git_clean ()
4491{
4492 __git_has_doubledash && return;
4493 local cur="${COMP_WORDS[COMP_CWORD]}";
4494 case "$cur" in
4495 --*)
4496 __gitcomp "--dry-run --quiet";
4497 return
4498 ;;
4499 esac;
4500 COMPREPLY=()
4501}
4502_git_clone ()
4503{
4504 local cur="${COMP_WORDS[COMP_CWORD]}";
4505 case "$cur" in
4506 --*)
4507 __gitcomp "
4508 --local
4509 --no-hardlinks
4510 --shared
4511 --reference
4512 --quiet
4513 --no-checkout
4514 --bare
4515 --mirror
4516 --origin
4517 --upload-pack
4518 --template=
4519 --depth
4520 ";
4521 return
4522 ;;
4523 esac;
4524 COMPREPLY=()
4525}
4526_git_commit ()
4527{
4528 __git_has_doubledash && return;
4529 local cur="${COMP_WORDS[COMP_CWORD]}";
4530 case "$cur" in
4531 --*)
4532 __gitcomp "
4533 --all --author= --signoff --verify --no-verify
4534 --edit --amend --include --only --interactive
4535 ";
4536 return
4537 ;;
4538 esac;
4539 COMPREPLY=()
4540}
4541_git_config ()
4542{
4543 local cur="${COMP_WORDS[COMP_CWORD]}";
4544 local prv="${COMP_WORDS[COMP_CWORD-1]}";
4545 case "$prv" in
4546 branch.*.remote)
4547 __gitcomp "$(__git_remotes)";
4548 return
4549 ;;
4550 branch.*.merge)
4551 __gitcomp "$(__git_refs)";
4552 return
4553 ;;
4554 remote.*.fetch)
4555 local remote="${prv#remote.}";
4556 remote="${remote%.fetch}";
4557 __gitcomp "$(__git_refs_remotes "$remote")";
4558 return
4559 ;;
4560 remote.*.push)
4561 local remote="${prv#remote.}";
4562 remote="${remote%.push}";
4563 __gitcomp "$(git --git-dir="$(__gitdir)" for-each-ref --format='%(refname):%(refname)' refs/heads)";
4564 return
4565 ;;
4566 pull.twohead | pull.octopus)
4567 __gitcomp "$(__git_merge_strategies)";
4568 return
4569 ;;
4570 color.branch | color.diff | color.interactive | color.status | color.ui)
4571 __gitcomp "always never auto";
4572 return
4573 ;;
4574 color.pager)
4575 __gitcomp "false true";
4576 return
4577 ;;
4578 color.*.*)
4579 __gitcomp "
4580 normal black red green yellow blue magenta cyan white
4581 bold dim ul blink reverse
4582 ";
4583 return
4584 ;;
4585 help.format)
4586 __gitcomp "man info web html";
4587 return
4588 ;;
4589 log.date)
4590 __gitcomp "$__git_log_date_formats";
4591 return
4592 ;;
4593 sendemail.aliasesfiletype)
4594 __gitcomp "mutt mailrc pine elm gnus";
4595 return
4596 ;;
4597 sendemail.confirm)
4598 __gitcomp "$__git_send_email_confirm_options";
4599 return
4600 ;;
4601 sendemail.suppresscc)
4602 __gitcomp "$__git_send_email_suppresscc_options";
4603 return
4604 ;;
4605 *.*)
4606 COMPREPLY=();
4607 return
4608 ;;
4609 esac;
4610 case "$cur" in
4611 --*)
4612 __gitcomp "
4613 --global --system --file=
4614 --list --replace-all
4615 --get --get-all --get-regexp
4616 --add --unset --unset-all
4617 --remove-section --rename-section
4618 ";
4619 return
4620 ;;
4621 branch.*.*)
4622 local pfx="${cur%.*}.";
4623 cur="${cur##*.}";
4624 __gitcomp "remote merge mergeoptions" "$pfx" "$cur";
4625 return
4626 ;;
4627 branch.*)
4628 local pfx="${cur%.*}.";
4629 cur="${cur#*.}";
4630 __gitcomp "$(__git_heads)" "$pfx" "$cur" ".";
4631 return
4632 ;;
4633 guitool.*.*)
4634 local pfx="${cur%.*}.";
4635 cur="${cur##*.}";
4636 __gitcomp "
4637 argprompt cmd confirm needsfile noconsole norescan
4638 prompt revprompt revunmerged title
4639 " "$pfx" "$cur";
4640 return
4641 ;;
4642 difftool.*.*)
4643 local pfx="${cur%.*}.";
4644 cur="${cur##*.}";
4645 __gitcomp "cmd path" "$pfx" "$cur";
4646 return
4647 ;;
4648 man.*.*)
4649 local pfx="${cur%.*}.";
4650 cur="${cur##*.}";
4651 __gitcomp "cmd path" "$pfx" "$cur";
4652 return
4653 ;;
4654 mergetool.*.*)
4655 local pfx="${cur%.*}.";
4656 cur="${cur##*.}";
4657 __gitcomp "cmd path trustExitCode" "$pfx" "$cur";
4658 return
4659 ;;
4660 pager.*)
4661 local pfx="${cur%.*}.";
4662 cur="${cur#*.}";
4663 __gitcomp "$(__git_all_commands)" "$pfx" "$cur";
4664 return
4665 ;;
4666 remote.*.*)
4667 local pfx="${cur%.*}.";
4668 cur="${cur##*.}";
4669 __gitcomp "
4670 url proxy fetch push mirror skipDefaultUpdate
4671 receivepack uploadpack tagopt
4672 " "$pfx" "$cur";
4673 return
4674 ;;
4675 remote.*)
4676 local pfx="${cur%.*}.";
4677 cur="${cur#*.}";
4678 __gitcomp "$(__git_remotes)" "$pfx" "$cur" ".";
4679 return
4680 ;;
4681 url.*.*)
4682 local pfx="${cur%.*}.";
4683 cur="${cur##*.}";
4684 __gitcomp "insteadof" "$pfx" "$cur";
4685 return
4686 ;;
4687 esac;
4688 __gitcomp "
4689 alias.
4690 apply.whitespace
4691 branch.autosetupmerge
4692 branch.autosetuprebase
4693 clean.requireForce
4694 color.branch
4695 color.branch.current
4696 color.branch.local
4697 color.branch.plain
4698 color.branch.remote
4699 color.diff
4700 color.diff.commit
4701 color.diff.frag
4702 color.diff.meta
4703 color.diff.new
4704 color.diff.old
4705 color.diff.plain
4706 color.diff.whitespace
4707 color.grep
4708 color.grep.external
4709 color.grep.match
4710 color.interactive
4711 color.interactive.header
4712 color.interactive.help
4713 color.interactive.prompt
4714 color.pager
4715 color.status
4716 color.status.added
4717 color.status.changed
4718 color.status.header
4719 color.status.nobranch
4720 color.status.untracked
4721 color.status.updated
4722 color.ui
4723 commit.template
4724 core.autocrlf
4725 core.bare
4726 core.compression
4727 core.createObject
4728 core.deltaBaseCacheLimit
4729 core.editor
4730 core.excludesfile
4731 core.fileMode
4732 core.fsyncobjectfiles
4733 core.gitProxy
4734 core.ignoreCygwinFSTricks
4735 core.ignoreStat
4736 core.logAllRefUpdates
4737 core.loosecompression
4738 core.packedGitLimit
4739 core.packedGitWindowSize
4740 core.pager
4741 core.preferSymlinkRefs
4742 core.preloadindex
4743 core.quotepath
4744 core.repositoryFormatVersion
4745 core.safecrlf
4746 core.sharedRepository
4747 core.symlinks
4748 core.trustctime
4749 core.warnAmbiguousRefs
4750 core.whitespace
4751 core.worktree
4752 diff.autorefreshindex
4753 diff.external
4754 diff.mnemonicprefix
4755 diff.renameLimit
4756 diff.renameLimit.
4757 diff.renames
4758 diff.suppressBlankEmpty
4759 diff.tool
4760 diff.wordRegex
4761 difftool.
4762 difftool.prompt
4763 fetch.unpackLimit
4764 format.attach
4765 format.cc
4766 format.headers
4767 format.numbered
4768 format.pretty
4769 format.signoff
4770 format.subjectprefix
4771 format.suffix
4772 format.thread
4773 gc.aggressiveWindow
4774 gc.auto
4775 gc.autopacklimit
4776 gc.packrefs
4777 gc.pruneexpire
4778 gc.reflogexpire
4779 gc.reflogexpireunreachable
4780 gc.rerereresolved
4781 gc.rerereunresolved
4782 gitcvs.allbinary
4783 gitcvs.commitmsgannotation
4784 gitcvs.dbTableNamePrefix
4785 gitcvs.dbdriver
4786 gitcvs.dbname
4787 gitcvs.dbpass
4788 gitcvs.dbuser
4789 gitcvs.enabled
4790 gitcvs.logfile
4791 gitcvs.usecrlfattr
4792 guitool.
4793 gui.blamehistoryctx
4794 gui.commitmsgwidth
4795 gui.copyblamethreshold
4796 gui.diffcontext
4797 gui.encoding
4798 gui.fastcopyblame
4799 gui.matchtrackingbranch
4800 gui.newbranchtemplate
4801 gui.pruneduringfetch
4802 gui.spellingdictionary
4803 gui.trustmtime
4804 help.autocorrect
4805 help.browser
4806 help.format
4807 http.lowSpeedLimit
4808 http.lowSpeedTime
4809 http.maxRequests
4810 http.noEPSV
4811 http.proxy
4812 http.sslCAInfo
4813 http.sslCAPath
4814 http.sslCert
4815 http.sslKey
4816 http.sslVerify
4817 i18n.commitEncoding
4818 i18n.logOutputEncoding
4819 imap.folder
4820 imap.host
4821 imap.pass
4822 imap.port
4823 imap.preformattedHTML
4824 imap.sslverify
4825 imap.tunnel
4826 imap.user
4827 instaweb.browser
4828 instaweb.httpd
4829 instaweb.local
4830 instaweb.modulepath
4831 instaweb.port
4832 interactive.singlekey
4833 log.date
4834 log.showroot
4835 mailmap.file
4836 man.
4837 man.viewer
4838 merge.conflictstyle
4839 merge.log
4840 merge.renameLimit
4841 merge.stat
4842 merge.tool
4843 merge.verbosity
4844 mergetool.
4845 mergetool.keepBackup
4846 mergetool.prompt
4847 pack.compression
4848 pack.deltaCacheLimit
4849 pack.deltaCacheSize
4850 pack.depth
4851 pack.indexVersion
4852 pack.packSizeLimit
4853 pack.threads
4854 pack.window
4855 pack.windowMemory
4856 pager.
4857 pull.octopus
4858 pull.twohead
4859 push.default
4860 rebase.stat
4861 receive.denyCurrentBranch
4862 receive.denyDeletes
4863 receive.denyNonFastForwards
4864 receive.fsckObjects
4865 receive.unpackLimit
4866 repack.usedeltabaseoffset
4867 rerere.autoupdate
4868 rerere.enabled
4869 sendemail.aliasesfile
4870 sendemail.aliasesfiletype
4871 sendemail.bcc
4872 sendemail.cc
4873 sendemail.cccmd
4874 sendemail.chainreplyto
4875 sendemail.confirm
4876 sendemail.envelopesender
4877 sendemail.multiedit
4878 sendemail.signedoffbycc
4879 sendemail.smtpencryption
4880 sendemail.smtppass
4881 sendemail.smtpserver
4882 sendemail.smtpserverport
4883 sendemail.smtpuser
4884 sendemail.suppresscc
4885 sendemail.suppressfrom
4886 sendemail.thread
4887 sendemail.to
4888 sendemail.validate
4889 showbranch.default
4890 status.relativePaths
4891 status.showUntrackedFiles
4892 tar.umask
4893 transfer.unpackLimit
4894 url.
4895 user.email
4896 user.name
4897 user.signingkey
4898 web.browser
4899 branch. remote.
4900 "
4901}
4902_git_describe ()
4903{
4904 local cur="${COMP_WORDS[COMP_CWORD]}";
4905 case "$cur" in
4906 --*)
4907 __gitcomp "
4908 --all --tags --contains --abbrev= --candidates=
4909 --exact-match --debug --long --match --always
4910 ";
4911 return
4912 ;;
4913 esac;
4914 __gitcomp "$(__git_refs)"
4915}
4916_git_diff ()
4917{
4918 __git_has_doubledash && return;
4919 local cur="${COMP_WORDS[COMP_CWORD]}";
4920 case "$cur" in
4921 --*)
4922 __gitcomp "--cached --staged --pickaxe-all --pickaxe-regex
4923 --base --ours --theirs
4924 $__git_diff_common_options
4925 ";
4926 return
4927 ;;
4928 esac;
4929 __git_complete_file
4930}
4931_git_difftool ()
4932{
4933 local cur="${COMP_WORDS[COMP_CWORD]}";
4934 case "$cur" in
4935 --tool=*)
4936 __gitcomp "$__git_mergetools_common kompare" "" "${cur##--tool=}";
4937 return
4938 ;;
4939 --*)
4940 __gitcomp "--tool=";
4941 return
4942 ;;
4943 esac;
4944 COMPREPLY=()
4945}
4946_git_fetch ()
4947{
4948 local cur="${COMP_WORDS[COMP_CWORD]}";
4949 case "$cur" in
4950 --*)
4951 __gitcomp "$__git_fetch_options";
4952 return
4953 ;;
4954 esac;
4955 __git_complete_remote_or_refspec
4956}
4957_git_format_patch ()
4958{
4959 local cur="${COMP_WORDS[COMP_CWORD]}";
4960 case "$cur" in
4961 --thread=*)
4962 __gitcomp "
4963 deep shallow
4964 " "" "${cur##--thread=}";
4965 return
4966 ;;
4967 --*)
4968 __gitcomp "
4969 --stdout --attach --no-attach --thread --thread=
4970 --output-directory
4971 --numbered --start-number
4972 --numbered-files
4973 --keep-subject
4974 --signoff
4975 --in-reply-to= --cc=
4976 --full-index --binary
4977 --not --all
4978 --cover-letter
4979 --no-prefix --src-prefix= --dst-prefix=
4980 --inline --suffix= --ignore-if-in-upstream
4981 --subject-prefix=
4982 ";
4983 return
4984 ;;
4985 esac;
4986 __git_complete_revlist
4987}
4988_git_fsck ()
4989{
4990 local cur="${COMP_WORDS[COMP_CWORD]}";
4991 case "$cur" in
4992 --*)
4993 __gitcomp "
4994 --tags --root --unreachable --cache --no-reflogs --full
4995 --strict --verbose --lost-found
4996 ";
4997 return
4998 ;;
4999 esac;
5000 COMPREPLY=()
5001}
5002_git_gc ()
5003{
5004 local cur="${COMP_WORDS[COMP_CWORD]}";
5005 case "$cur" in
5006 --*)
5007 __gitcomp "--prune --aggressive";
5008 return
5009 ;;
5010 esac;
5011 COMPREPLY=()
5012}
5013_git_grep ()
5014{
5015 __git_has_doubledash && return;
5016 local cur="${COMP_WORDS[COMP_CWORD]}";
5017 case "$cur" in
5018 --*)
5019 __gitcomp "
5020 --cached
5021 --text --ignore-case --word-regexp --invert-match
5022 --full-name
5023 --extended-regexp --basic-regexp --fixed-strings
5024 --files-with-matches --name-only
5025 --files-without-match
5026 --count
5027 --and --or --not --all-match
5028 ";
5029 return
5030 ;;
5031 esac;
5032 COMPREPLY=()
5033}
5034_git_help ()
5035{
5036 local cur="${COMP_WORDS[COMP_CWORD]}";
5037 case "$cur" in
5038 --*)
5039 __gitcomp "--all --info --man --web";
5040 return
5041 ;;
5042 esac;
5043 __gitcomp "$(__git_all_commands)
5044 attributes cli core-tutorial cvs-migration
5045 diffcore gitk glossary hooks ignore modules
5046 repository-layout tutorial tutorial-2
5047 workflows
5048 "
5049}
5050_git_init ()
5051{
5052 local cur="${COMP_WORDS[COMP_CWORD]}";
5053 case "$cur" in
5054 --shared=*)
5055 __gitcomp "
5056 false true umask group all world everybody
5057 " "" "${cur##--shared=}";
5058 return
5059 ;;
5060 --*)
5061 __gitcomp "--quiet --bare --template= --shared --shared=";
5062 return
5063 ;;
5064 esac;
5065 COMPREPLY=()
5066}
5067_git_log ()
5068{
5069 __git_has_doubledash && return;
5070 local cur="${COMP_WORDS[COMP_CWORD]}";
5071 local g="$(git rev-parse --git-dir 2>/dev/null)";
5072 local merge="";
5073 if [ -f "$g/MERGE_HEAD" ]; then
5074 merge="--merge";
5075 fi;
5076 case "$cur" in
5077 --pretty=*)
5078 __gitcomp "$__git_log_pretty_formats
5079 " "" "${cur##--pretty=}";
5080 return
5081 ;;
5082 --format=*)
5083 __gitcomp "$__git_log_pretty_formats
5084 " "" "${cur##--format=}";
5085 return
5086 ;;
5087 --date=*)
5088 __gitcomp "$__git_log_date_formats" "" "${cur##--date=}";
5089 return
5090 ;;
5091 --*)
5092 __gitcomp "
5093 $__git_log_common_options
5094 $__git_log_shortlog_options
5095 $__git_log_gitk_options
5096 --root --topo-order --date-order --reverse
5097 --follow
5098 --abbrev-commit --abbrev=
5099 --relative-date --date=
5100 --pretty= --format= --oneline
5101 --cherry-pick
5102 --graph
5103 --decorate
5104 --walk-reflogs
5105 --parents --children
5106 $merge
5107 $__git_diff_common_options
5108 --pickaxe-all --pickaxe-regex
5109 ";
5110 return
5111 ;;
5112 esac;
5113 __git_complete_revlist
5114}
5115_git_ls_files ()
5116{
5117 __git_has_doubledash && return;
5118 local cur="${COMP_WORDS[COMP_CWORD]}";
5119 case "$cur" in
5120 --*)
5121 __gitcomp "--cached --deleted --modified --others --ignored
5122 --stage --directory --no-empty-directory --unmerged
5123 --killed --exclude= --exclude-from=
5124 --exclude-per-directory= --exclude-standard
5125 --error-unmatch --with-tree= --full-name
5126 --abbrev --ignored --exclude-per-directory
5127 ";
5128 return
5129 ;;
5130 esac;
5131 COMPREPLY=()
5132}
5133_git_ls_remote ()
5134{
5135 __gitcomp "$(__git_remotes)"
5136}
5137_git_ls_tree ()
5138{
5139 __git_complete_file
5140}
5141_git_merge ()
5142{
5143 __git_complete_strategy && return;
5144 local cur="${COMP_WORDS[COMP_CWORD]}";
5145 case "$cur" in
5146 --*)
5147 __gitcomp "$__git_merge_options";
5148 return
5149 ;;
5150 esac;
5151 __gitcomp "$(__git_refs)"
5152}
5153_git_merge_base ()
5154{
5155 __gitcomp "$(__git_refs)"
5156}
5157_git_mergetool ()
5158{
5159 local cur="${COMP_WORDS[COMP_CWORD]}";
5160 case "$cur" in
5161 --tool=*)
5162 __gitcomp "$__git_mergetools_common tortoisemerge" "" "${cur##--tool=}";
5163 return
5164 ;;
5165 --*)
5166 __gitcomp "--tool=";
5167 return
5168 ;;
5169 esac;
5170 COMPREPLY=()
5171}
5172_git_mv ()
5173{
5174 local cur="${COMP_WORDS[COMP_CWORD]}";
5175 case "$cur" in
5176 --*)
5177 __gitcomp "--dry-run";
5178 return
5179 ;;
5180 esac;
5181 COMPREPLY=()
5182}
5183_git_name_rev ()
5184{
5185 __gitcomp "--tags --all --stdin"
5186}
5187_git_pull ()
5188{
5189 __git_complete_strategy && return;
5190 local cur="${COMP_WORDS[COMP_CWORD]}";
5191 case "$cur" in
5192 --*)
5193 __gitcomp "
5194 --rebase --no-rebase
5195 $__git_merge_options
5196 $__git_fetch_options
5197 ";
5198 return
5199 ;;
5200 esac;
5201 __git_complete_remote_or_refspec
5202}
5203_git_push ()
5204{
5205 local cur="${COMP_WORDS[COMP_CWORD]}";
5206 case "${COMP_WORDS[COMP_CWORD-1]}" in
5207 --repo)
5208 __gitcomp "$(__git_remotes)";
5209 return
5210 ;;
5211 esac;
5212 case "$cur" in
5213 --repo=*)
5214 __gitcomp "$(__git_remotes)" "" "${cur##--repo=}";
5215 return
5216 ;;
5217 --*)
5218 __gitcomp "
5219 --all --mirror --tags --dry-run --force --verbose
5220 --receive-pack= --repo=
5221 ";
5222 return
5223 ;;
5224 esac;
5225 __git_complete_remote_or_refspec
5226}
5227_git_rebase ()
5228{
5229 local cur="${COMP_WORDS[COMP_CWORD]}" dir="$(__gitdir)";
5230 if [ -d "$dir"/rebase-apply ] || [ -d "$dir"/rebase-merge ]; then
5231 __gitcomp "--continue --skip --abort";
5232 return;
5233 fi;
5234 __git_complete_strategy && return;
5235 case "$cur" in
5236 --*)
5237 __gitcomp "--onto --merge --strategy --interactive";
5238 return
5239 ;;
5240 esac;
5241 __gitcomp "$(__git_refs)"
5242}
5243_git_remote ()
5244{
5245 local subcommands="add rename rm show prune update set-head";
5246 local subcommand="$(__git_find_subcommand "$subcommands")";
5247 if [ -z "$subcommand" ]; then
5248 __gitcomp "$subcommands";
5249 return;
5250 fi;
5251 case "$subcommand" in
5252 rename | rm | show | prune)
5253 __gitcomp "$(__git_remotes)"
5254 ;;
5255 update)
5256 local i c='' IFS='
5257';
5258 for i in $(git --git-dir="$(__gitdir)" config --list);
5259 do
5260 case "$i" in
5261 remotes.*)
5262 i="${i#remotes.}";
5263 c="$c ${i/=*/}"
5264 ;;
5265 esac;
5266 done;
5267 __gitcomp "$c"
5268 ;;
5269 *)
5270 COMPREPLY=()
5271 ;;
5272 esac
5273}
5274_git_reset ()
5275{
5276 __git_has_doubledash && return;
5277 local cur="${COMP_WORDS[COMP_CWORD]}";
5278 case "$cur" in
5279 --*)
5280 __gitcomp "--merge --mixed --hard --soft";
5281 return
5282 ;;
5283 esac;
5284 __gitcomp "$(__git_refs)"
5285}
5286_git_revert ()
5287{
5288 local cur="${COMP_WORDS[COMP_CWORD]}";
5289 case "$cur" in
5290 --*)
5291 __gitcomp "--edit --mainline --no-edit --no-commit --signoff";
5292 return
5293 ;;
5294 esac;
5295 __gitcomp "$(__git_refs)"
5296}
5297_git_rm ()
5298{
5299 __git_has_doubledash && return;
5300 local cur="${COMP_WORDS[COMP_CWORD]}";
5301 case "$cur" in
5302 --*)
5303 __gitcomp "--cached --dry-run --ignore-unmatch --quiet";
5304 return
5305 ;;
5306 esac;
5307 COMPREPLY=()
5308}
5309_git_send_email ()
5310{
5311 local cur="${COMP_WORDS[COMP_CWORD]}";
5312 case "$cur" in
5313 --confirm=*)
5314 __gitcomp "
5315 $__git_send_email_confirm_options
5316 " "" "${cur##--confirm=}";
5317 return
5318 ;;
5319 --suppress-cc=*)
5320 __gitcomp "
5321 $__git_send_email_suppresscc_options
5322 " "" "${cur##--suppress-cc=}";
5323 return
5324 ;;
5325 --smtp-encryption=*)
5326 __gitcomp "ssl tls" "" "${cur##--smtp-encryption=}";
5327 return
5328 ;;
5329 --*)
5330 __gitcomp "--annotate --bcc --cc --cc-cmd --chain-reply-to
5331 --compose --confirm= --dry-run --envelope-sender
5332 --from --identity
5333 --in-reply-to --no-chain-reply-to --no-signed-off-by-cc
5334 --no-suppress-from --no-thread --quiet
5335 --signed-off-by-cc --smtp-pass --smtp-server
5336 --smtp-server-port --smtp-encryption= --smtp-user
5337 --subject --suppress-cc= --suppress-from --thread --to
5338 --validate --no-validate";
5339 return
5340 ;;
5341 esac;
5342 COMPREPLY=()
5343}
5344_git_shortlog ()
5345{
5346 __git_has_doubledash && return;
5347 local cur="${COMP_WORDS[COMP_CWORD]}";
5348 case "$cur" in
5349 --*)
5350 __gitcomp "
5351 $__git_log_common_options
5352 $__git_log_shortlog_options
5353 --numbered --summary
5354 ";
5355 return
5356 ;;
5357 esac;
5358 __git_complete_revlist
5359}
5360_git_show ()
5361{
5362 __git_has_doubledash && return;
5363 local cur="${COMP_WORDS[COMP_CWORD]}";
5364 case "$cur" in
5365 --pretty=*)
5366 __gitcomp "$__git_log_pretty_formats
5367 " "" "${cur##--pretty=}";
5368 return
5369 ;;
5370 --format=*)
5371 __gitcomp "$__git_log_pretty_formats
5372 " "" "${cur##--format=}";
5373 return
5374 ;;
5375 --*)
5376 __gitcomp "--pretty= --format= --abbrev-commit --oneline
5377 $__git_diff_common_options
5378 ";
5379 return
5380 ;;
5381 esac;
5382 __git_complete_file
5383}
5384_git_show_branch ()
5385{
5386 local cur="${COMP_WORDS[COMP_CWORD]}";
5387 case "$cur" in
5388 --*)
5389 __gitcomp "
5390 --all --remotes --topo-order --current --more=
5391 --list --independent --merge-base --no-name
5392 --sha1-name --sparse --topics --reflog
5393 ";
5394 return
5395 ;;
5396 esac;
5397 __git_complete_revlist
5398}
5399_git_stash ()
5400{
5401 local subcommands='save list show apply clear drop pop create branch';
5402 local subcommand="$(__git_find_subcommand "$subcommands")";
5403 if [ -z "$subcommand" ]; then
5404 __gitcomp "$subcommands";
5405 else
5406 local cur="${COMP_WORDS[COMP_CWORD]}";
5407 case "$subcommand,$cur" in
5408 save,--*)
5409 __gitcomp "--keep-index"
5410 ;;
5411 apply,--*)
5412 __gitcomp "--index"
5413 ;;
5414 show,--* | drop,--* | pop,--* | branch,--*)
5415 COMPREPLY=()
5416 ;;
5417 show,* | apply,* | drop,* | pop,* | branch,*)
5418 __gitcomp "$(git --git-dir="$(__gitdir)" stash list | sed -n -e 's/:.*//p')"
5419 ;;
5420 *)
5421 COMPREPLY=()
5422 ;;
5423 esac;
5424 fi
5425}
5426_git_submodule ()
5427{
5428 __git_has_doubledash && return;
5429 local subcommands="add status init update summary foreach sync";
5430 if [ -z "$(__git_find_subcommand "$subcommands")" ]; then
5431 local cur="${COMP_WORDS[COMP_CWORD]}";
5432 case "$cur" in
5433 --*)
5434 __gitcomp "--quiet --cached"
5435 ;;
5436 *)
5437 __gitcomp "$subcommands"
5438 ;;
5439 esac;
5440 return;
5441 fi
5442}
5443_git_svn ()
5444{
5445 local subcommands="
5446 init fetch clone rebase dcommit log find-rev
5447 set-tree commit-diff info create-ignore propget
5448 proplist show-ignore show-externals branch tag blame
5449 migrate
5450 ";
5451 local subcommand="$(__git_find_subcommand "$subcommands")";
5452 if [ -z "$subcommand" ]; then
5453 __gitcomp "$subcommands";
5454 else
5455 local remote_opts="--username= --config-dir= --no-auth-cache";
5456 local fc_opts="
5457 --follow-parent --authors-file= --repack=
5458 --no-metadata --use-svm-props --use-svnsync-props
5459 --log-window-size= --no-checkout --quiet
5460 --repack-flags --use-log-author --localtime
5461 --ignore-paths= $remote_opts
5462 ";
5463 local init_opts="
5464 --template= --shared= --trunk= --tags=
5465 --branches= --stdlayout --minimize-url
5466 --no-metadata --use-svm-props --use-svnsync-props
5467 --rewrite-root= --prefix= --use-log-author
5468 --add-author-from $remote_opts
5469 ";
5470 local cmt_opts="
5471 --edit --rmdir --find-copies-harder --copy-similarity=
5472 ";
5473 local cur="${COMP_WORDS[COMP_CWORD]}";
5474 case "$subcommand,$cur" in
5475 fetch,--*)
5476 __gitcomp "--revision= --fetch-all $fc_opts"
5477 ;;
5478 clone,--*)
5479 __gitcomp "--revision= $fc_opts $init_opts"
5480 ;;
5481 init,--*)
5482 __gitcomp "$init_opts"
5483 ;;
5484 dcommit,--*)
5485 __gitcomp "
5486 --merge --strategy= --verbose --dry-run
5487 --fetch-all --no-rebase --commit-url
5488 --revision $cmt_opts $fc_opts
5489 "
5490 ;;
5491 set-tree,--*)
5492 __gitcomp "--stdin $cmt_opts $fc_opts"
5493 ;;
5494 create-ignore,--* | propget,--* | proplist,--* | show-ignore,--* | show-externals,--*)
5495 __gitcomp "--revision="
5496 ;;
5497 log,--*)
5498 __gitcomp "
5499 --limit= --revision= --verbose --incremental
5500 --oneline --show-commit --non-recursive
5501 --authors-file= --color
5502 "
5503 ;;
5504 rebase,--*)
5505 __gitcomp "
5506 --merge --verbose --strategy= --local
5507 --fetch-all --dry-run $fc_opts
5508 "
5509 ;;
5510 commit-diff,--*)
5511 __gitcomp "--message= --file= --revision= $cmt_opts"
5512 ;;
5513 info,--*)
5514 __gitcomp "--url"
5515 ;;
5516 branch,--*)
5517 __gitcomp "--dry-run --message --tag"
5518 ;;
5519 tag,--*)
5520 __gitcomp "--dry-run --message"
5521 ;;
5522 blame,--*)
5523 __gitcomp "--git-format"
5524 ;;
5525 migrate,--*)
5526 __gitcomp "
5527 --config-dir= --ignore-paths= --minimize
5528 --no-auth-cache --username=
5529 "
5530 ;;
5531 *)
5532 COMPREPLY=()
5533 ;;
5534 esac;
5535 fi
5536}
5537_git_tag ()
5538{
5539 local i c=1 f=0;
5540 while [ $c -lt $COMP_CWORD ]; do
5541 i="${COMP_WORDS[c]}";
5542 case "$i" in
5543 -d | -v)
5544 __gitcomp "$(__git_tags)";
5545 return
5546 ;;
5547 -f)
5548 f=1
5549 ;;
5550 esac;
5551 c=$((++c));
5552 done;
5553 case "${COMP_WORDS[COMP_CWORD-1]}" in
5554 -m | -F)
5555 COMPREPLY=()
5556 ;;
5557 -* | tag)
5558 if [ $f = 1 ]; then
5559 __gitcomp "$(__git_tags)";
5560 else
5561 COMPREPLY=();
5562 fi
5563 ;;
5564 *)
5565 __gitcomp "$(__git_refs)"
5566 ;;
5567 esac
5568}
5569_gitk ()
5570{
5571 __git_has_doubledash && return;
5572 local cur="${COMP_WORDS[COMP_CWORD]}";
5573 local g="$(__gitdir)";
5574 local merge="";
5575 if [ -f "$g/MERGE_HEAD" ]; then
5576 merge="--merge";
5577 fi;
5578 case "$cur" in
5579 --*)
5580 __gitcomp "
5581 $__git_log_common_options
5582 $__git_log_gitk_options
5583 $merge
5584 ";
5585 return
5586 ;;
5587 esac;
5588 __git_complete_revlist
5589}
5590_gkrellm ()
5591{
5592 local cur;
5593 COMPREPLY=();
5594 cur=`_get_cword`;
5595 prev=${COMP_WORDS[COMP_CWORD-1]};
5596 case "$prev" in
5597 -@(t|-theme))
5598 _filedir -d;
5599 return 0
5600 ;;
5601 -@(p|-plugin))
5602 _filedir 'so';
5603 return 0
5604 ;;
5605 -@(s|-server))
5606 _known_hosts;
5607 return 0
5608 ;;
5609 esac;
5610 if [[ "$cur" == -* ]]; then
5611 COMPREPLY=($( compgen -W '--help -t --theme -s --server \
5612 -g --geometry -wm -w --withdrawn -c --config -nc \
5613 -f --force-host-config -demo -p --plugin -P \
5614 --port' -- $cur ));
5615 fi
5616}
5617_gnatmake ()
5618{
5619 local cur;
5620 COMPREPLY=();
5621 cur=`_get_cword`;
5622 if [[ "$cur" == -* ]]; then
5623 COMPREPLY=($( compgen -W '-a -c -f -i -j -k -m -M -n -o \
5624 -q -s -v -z -aL -A -aO -aI -I -I- -L -nostdinc \
5625 -nostdlib -cargs -bargs -largs -fstack-check \
5626 -fno-inline -g -O1 -O0 -O2 -O3 -gnata -gnatA \
5627 -gnatb -gnatc -gnatd -gnatD -gnate -gnatE \
5628 -gnatf -gnatF -gnatg -gnatG -gnath -gnati \
5629 -gnatk -gnatl -gnatL -gnatm -gnatn -gnato \
5630 -gnatO -gnatp -gnatP -gnatq -gnatR -gnats \
5631 -gnatt -gnatT -gnatu -gnatU -gnatv -gnatws \
5632 -gnatwe -gnatwl -gnatwu -gnatW -gnatx -gnatX \
5633 -gnaty -gnatz -gnatZ -gnat83' -- $cur ));
5634 else
5635 _filedir '@(adb|ads)';
5636 fi
5637}
5638_gpg ()
5639{
5640 local cur prev;
5641 COMPREPLY=();
5642 cur=`_get_cword`;
5643 prev=${COMP_WORDS[COMP_CWORD-1]};
5644 case "$prev" in
5645 -@(s|-sign|-clearsign|-decrypt-files|-load-extension))
5646 _filedir;
5647 return 0
5648 ;;
5649 --@(export|@(?(l|nr|nrl)sign|edit)-key))
5650 COMPREPLY=($( compgen -W "$( gpg --list-keys 2>/dev/null | sed -ne 's@^pub.*/\([^ ]*\).*$@\1@p;s@^.*\(<\([^>]*\)>\).*$@\2@p')" -- "$cur" ));
5651 return 0
5652 ;;
5653 -@(r|-recipient))
5654 COMPREPLY=($( compgen -W "$( gpg --list-keys 2>/dev/null | sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" ));
5655 if [ -e ~/.gnupg/gpg.conf ]; then
5656 COMPREPLY=("${COMPREPLY[@]}" $( compgen -W "$( sed -ne 's@^[ \t]*group[ \t][ \t]*\([^=]*\).*$@\1@p' ~/.gnupg/gpg.conf )" -- "$cur"));
5657 fi;
5658 return 0
5659 ;;
5660 esac;
5661 if [[ "$cur" == -* ]]; then
5662 COMPREPLY=($( compgen -W '-s -b -e -f -c -d -a -r -u -Z -o -v\
5663 -q -n -N $(gpg --dump-options)' -- $cur ));
5664 fi
5665}
5666_gzip ()
5667{
5668 local cur prev xspec helpopts;
5669 COMPREPLY=();
5670 cur=`_get_cword`;
5671 prev=${COMP_WORDS[COMP_CWORD-1]};
5672 helpopts=`_parse_help gzip`;
5673 if [[ "$cur" == -* ]]; then
5674 COMPREPLY=($( compgen -W "$helpopts -2 -3 -4 -5 -6 -7 -8" -- "$cur" ));
5675 return 0;
5676 fi;
5677 local IFS='
5678';
5679 xspec="*.?(t)gz";
5680 if [[ "$prev" == --* ]]; then
5681 [[ "$prev" == --decompress || "$prev" == --list || "$prev" == --test ]] && xspec="!"$xspec;
5682 [[ "$prev" == --force ]] && xspec=;
5683 else
5684 if [[ "$prev" == -* ]]; then
5685 [[ "$prev" == -*[dlt]* ]] && xspec="!"$xspec;
5686 [[ "$prev" == -*f* ]] && xspec=;
5687 else
5688 if [ "$prev" = '>' -o "$prev" = '>>' ]; then
5689 xspec=;
5690 else
5691 if [ "$prev" = '<' ]; then
5692 xspec=;
5693 fi;
5694 fi;
5695 fi;
5696 fi;
5697 _expand || return 0;
5698 COMPREPLY=($( compgen -f -X "$xspec" -- $cur ) $( compgen -d -- $cur ))
5699}
5700_iconv ()
5701{
5702 local cur prev;
5703 COMPREPLY=();
5704 cur=`_get_cword`;
5705 prev=${COMP_WORDS[COMP_CWORD-1]};
5706 case "$prev" in
5707 -@(f|t|-@(from|to)-code))
5708 COMPREPLY=($( compgen -W '$( iconv --list | sed -e "s@//@@;" )' -- "$cur" ));
5709 return 0
5710 ;;
5711 esac;
5712 if [[ "$cur" = -* ]]; then
5713 COMPREPLY=($( compgen -W '--from-code -f --to-code -t --list
5714 --output -o --verbose' -- "$cur" ));
5715 return 0;
5716 fi
5717}
5718_id ()
5719{
5720 local cur;
5721 COMPREPLY=();
5722 cur=`_get_cword`;
5723 if [[ "$cur" == -* ]]; then
5724 COMPREPLY=($( compgen -W '-a -g --group -G --groups -n --name\
5725 -r --real -u --user --help --version' -- $cur ));
5726 else
5727 COMPREPLY=($( compgen -u $cur ));
5728 fi
5729}
5730_ifupdown ()
5731{
5732 local cur;
5733 COMPREPLY=();
5734 cur=`_get_cword`;
5735 if [ $COMP_CWORD -eq 1 ]; then
5736 _configured_interfaces;
5737 COMPREPLY=($(compgen -W '${COMPREPLY[@]}' -- "$cur"));
5738 fi;
5739 return 0
5740}
5741_info ()
5742{
5743 local cur infopath;
5744 COMPREPLY=();
5745 cur=`_get_cword`;
5746 _expand || return 0;
5747 if [[ "$cur" == */* ]]; then
5748 _filedir;
5749 return 0;
5750 fi;
5751 infopath='/usr/share/info';
5752 if [ "${INFOPATH: -1:1}" == ':' ]; then
5753 infopath=${INFOPATH}${infopath};
5754 else
5755 if [ ${INFOPATH:+set} ]; then
5756 infopath=$INFOPATH;
5757 fi;
5758 fi;
5759 infopath=$infopath:;
5760 if [ -n "$cur" ]; then
5761 infopath="${infopath//://$cur* }";
5762 else
5763 infopath="${infopath//:// }";
5764 fi;
5765 COMPREPLY=($( eval command ls "$infopath" 2>/dev/null ));
5766 COMPREPLY=(${COMPREPLY[@]##*/?(:)});
5767 for ((i=0 ; i < ${#COMPREPLY[@]} ; ++i ))
5768 do
5769 if [ "${COMPREPLY[$i]}" == 'dir' ]; then
5770 unset COMPREPLY[$i];
5771 fi;
5772 done;
5773 COMPREPLY=(${COMPREPLY[@]%.@(gz|bz2|lzma)});
5774 COMPREPLY=($( compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}" ));
5775 return 0
5776}
5777_inject ()
5778{
5779 local cur prev;
5780 COMPREPLY=();
5781 cur=`_get_cword`;
5782 prev=${COMP_WORDS[COMP_CWORD-1]};
5783 case "$prev" in
5784 -@(l|-listname=))
5785 _mailman_lists;
5786 return 0
5787 ;;
5788 esac;
5789 if [[ "$cur" == -* ]]; then
5790 COMPREPLY=($( compgen -W '-l --listname= -q --queue= \
5791 -h --help' -- $cur ));
5792 else
5793 _filedir;
5794 fi
5795}
5796_insmod ()
5797{
5798 local cur prev modpath;
5799 COMPREPLY=();
5800 cur=`_get_cword`;
5801 prev=${COMP_WORDS[COMP_CWORD-1]};
5802 if [ $1 = "modprobe" ] && [ "${COMP_WORDS[1]}" = "-r" ]; then
5803 _installed_modules "$cur";
5804 return 0;
5805 fi;
5806 if [[ "$cur" == */* ]]; then
5807 _filedir '@(?(k)o?(.gz))';
5808 return 0;
5809 fi;
5810 if [ $COMP_CWORD -gt 1 ] && [[ "${COMP_WORDS[COMP_CWORD-1]}" != -* ]]; then
5811 COMPREPLY=($( /sbin/modinfo -p ${COMP_WORDS[1]} 2>/dev/null | awk '{if ($1 ~ /^parm:/ && $2 ~ /^'$cur'/) { print $2 } \
5812 else if ($1 !~ /:/ && $1 ~ /^'$cur'/) { print $1 }}' ));
5813 else
5814 _modules $(uname -r);
5815 fi;
5816 return 0
5817}
5818_insserv ()
5819{
5820 local cur prev sysvdir services options;
5821 cur=`_get_cword`;
5822 prev=${COMP_WORDS[COMP_CWORD-1]};
5823 [ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d || sysvdir=/etc/init.d;
5824 services=($(echo $sysvdir/!(README*|*.dpkg*|*.rpm@(orig|new|save))));
5825 services=(${services[@]#$sysvdir/});
5826 options=(-c --config -d -f -n -o --override -p --path -r -v);
5827 case "$prev" in
5828 -c | --config)
5829 _filedir
5830 ;;
5831 -o | --override | -p | --path)
5832 _filedir -d
5833 ;;
5834 *)
5835 COMPREPLY=($( compgen -W '${options[@]} ${services[@]}' -- $cur ))
5836 ;;
5837 esac;
5838 return 0
5839}
5840_installed_modules ()
5841{
5842 COMPREPLY=($( compgen -W "$( /sbin/lsmod | awk '{if (NR != 1) print $1}' )" -- $1 ))
5843}
5844_invoke_rc_d ()
5845{
5846 local cur prev sysvdir services options valid_options;
5847 cur=`_get_cword`;
5848 prev=${COMP_WORDS[COMP_CWORD-1]};
5849 [ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d || sysvdir=/etc/init.d;
5850 services=($(echo $sysvdir/!(README*|*.sh|*.dpkg*|*.rpm@(orig|new|save))));
5851 services=(${services[@]#$sysvdir/});
5852 options=(--help --quiet --force --try-anyway --disclose-deny --query --no-fallback);
5853 if [[ ( $COMP_CWORD -eq 1 ) || ( "$prev" == --* ) ]]; then
5854 valid_options=($( echo ${COMP_WORDS[@]} ${options[@]} | tr " " "\n" | sed -ne "/$( echo ${options[@]} | sed "s/ /\\\\|/g" )/p" | sort | uniq -u ));
5855 COMPREPLY=($( compgen -W '${valid_options[@]} ${services[@]}' -- $cur ));
5856 else
5857 if [ -x $sysvdir/$prev ]; then
5858 COMPREPLY=($( compgen -W '`sed -ne "y/|/ /; \
5859 s/^.*Usage:[ ]*[^ ]*[ ]*{*\([^}\"]*\).*$/\1/p" \
5860 $sysvdir/$prev`' -- $cur ));
5861 else
5862 COMPREPLY=();
5863 fi;
5864 fi;
5865 return 0
5866}
5867_iptables ()
5868{
5869 local cur prev table chain;
5870 COMPREPLY=();
5871 cur=`_get_cword`;
5872 prev=${COMP_WORDS[COMP_CWORD-1]};
5873 chain='s/^Chain \([^ ]\+\).*$/\1/p';
5874 if [[ $COMP_LINE == *-t\ *filter* ]]; then
5875 table="-t filter";
5876 else
5877 if [[ $COMP_LINE == *-t\ *nat* ]]; then
5878 table="-t nat";
5879 else
5880 if [[ $COMP_LINE == *-t\ *mangle* ]]; then
5881 table="-t mangle";
5882 fi;
5883 fi;
5884 fi;
5885 case "$prev" in
5886 -*[AIDRPFXLZ])
5887 COMPREPLY=($( compgen -W '`iptables $table -nL | \
5888 sed -ne "s/^Chain \([^ ]\+\).*$/\1/p"`' -- $cur ))
5889 ;;
5890 -*t)
5891 COMPREPLY=($( compgen -W 'nat filter mangle' -- $cur ))
5892 ;;
5893 -j)
5894 if [ "$table" = "-t filter" -o "$table" = "" ]; then
5895 COMPREPLY=($( compgen -W 'ACCEPT DROP LOG ULOG REJECT \
5896 `iptables $table -nL | sed -ne "$chain" \
5897 -e "s/INPUT|OUTPUT|FORWARD|PREROUTING|POSTROUTING//"`' -- $cur ));
5898 else
5899 if [ "$table" = "-t nat" ]; then
5900 COMPREPLY=($( compgen -W 'ACCEPT DROP LOG ULOG REJECT \
5901 MIRROR SNAT DNAT MASQUERADE `iptables $table -nL | \
5902 sed -ne "$chain" -e "s/OUTPUT|PREROUTING|POSTROUTING//"`' -- $cur ));
5903 else
5904 if [ "$table" = "-t mangle" ]; then
5905 COMPREPLY=($( compgen -W 'ACCEPT DROP LOG ULOG REJECT \
5906 MARK TOS `iptables $table -nL | sed -ne "$chain" \
5907 -e "s/INPUT|OUTPUT|FORWARD|PREROUTING|POSTROUTING//"`' -- $cur ));
5908 fi;
5909 fi;
5910 fi
5911 ;;
5912 *)
5913 if [[ "$cur" == -* ]]; then
5914 COMPREPLY=($( compgen -W '-i -o -s -d -p -f -m --append \
5915 --delete --insert --replace --list --flush --zero --new \
5916 --delete-chain --policy --rename-chain --proto --source \
5917 --destination --in-interface --jump --match --numeric \
5918 --out-interface --table --verbose --line-numbers --exact \
5919 --fragment --modprobe= --set-counters --version' -- "$cur"));
5920 fi
5921 ;;
5922 esac
5923}
5924_isql ()
5925{
5926 local cur;
5927 cur=`_get_cword`;
5928 [ -f "$ODBCINI" ] && COMPREPLY=($( grep \\[$cur "$ODBCINI" | tr -d \\[\\] ))
5929}
5930_iwconfig ()
5931{
5932 local cur prev;
5933 COMPREPLY=();
5934 cur=`_get_cword`;
5935 prev=${COMP_WORDS[COMP_CWORD-1]};
5936 case $prev in
5937 mode)
5938 COMPREPLY=($( compgen -W 'managed ad-hoc master \
5939 repeater secondary monitor' -- $cur ));
5940 return 0
5941 ;;
5942 essid)
5943 COMPREPLY=($( compgen -W 'on off any' -- $cur ));
5944 if [ -n "${COMP_IWLIST_SCAN:-}" ]; then
5945 COMPREPLY=("${COMPREPLY[@]}" $( iwlist ${COMP_WORDS[1]} scan | awk -F '"' '/ESSID/ {print $2}' | grep "^$cur" ));
5946 fi;
5947 return 0
5948 ;;
5949 nwid)
5950 COMPREPLY=($( compgen -W 'on off' -- $cur ));
5951 return 0
5952 ;;
5953 channel)
5954 COMPREPLY=($( iwlist ${COMP_WORDS[1]} channel | awk '/^[[:space:]]*Channel/ {print $2}' | grep "^$cur" ));
5955 return 0
5956 ;;
5957 freq)
5958 COMPREPLY=($( iwlist ${COMP_WORDS[1]} channel | awk '/^[[:space:]]*Channel/ {print $4"G"}' | grep "^$cur" ));
5959 return 0
5960 ;;
5961 ap)
5962 COMPREPLY=($( compgen -W 'on off any' -- $cur ));
5963 if [ -n "${COMP_IWLIST_SCAN:-}" ]; then
5964 COMPREPLY=("${COMPREPLY[@]}" $( iwlist ${COMP_WORDS[1]} scan | awk -F ': ' '/Address/ {print $2}' | grep "^$cur" ));
5965 fi;
5966 return 0
5967 ;;
5968 rate)
5969 COMPREPLY=($( compgen -W 'auto fixed' -- $cur ));
5970 COMPREPLY=("${COMPREPLY[@]}" $( iwlist ${COMP_WORDS[1]} rate | awk '/^[[:space:]]*[0-9]/ {print $1"M"}' | grep "^$cur" ));
5971 return 0
5972 ;;
5973 rts)
5974 COMPREPLY=($( compgen -W 'auto fixed off' -- $cur ));
5975 return 0
5976 ;;
5977 frag)
5978 COMPREPLY=($( compgen -W 'auto fixed off' -- $cur ));
5979 return 0
5980 ;;
5981 key)
5982 COMPREPLY=($( compgen -W 'off on open restricted' -- $cur ));
5983 return 0
5984 ;;
5985 enc)
5986 COMPREPLY=($( compgen -W 'off on open restricted' -- $cur ));
5987 return 0
5988 ;;
5989 power)
5990 COMPREPLY=($( compgen -W 'period timeout off on' -- $cur ));
5991 return 0
5992 ;;
5993 txpower)
5994 COMPREPLY=($( compgen -W 'off on auto' -- $cur ));
5995 return 0
5996 ;;
5997 retry)
5998 COMPREPLY=($( compgen -W 'limit lifetime' -- $cur ));
5999 return 0
6000 ;;
6001 esac;
6002 if [ $COMP_CWORD -eq 1 ]; then
6003 if [[ "$cur" == -* ]]; then
6004 COMPREPLY=($( compgen -W '--help --version' -- $cur ));
6005 else
6006 _available_interfaces -w;
6007 fi;
6008 else
6009 COMPREPLY=($( compgen -W 'essid nwid mode freq channel sens mode \
6010 ap nick rate rts frag enc key power txpower commit' -- $cur ));
6011 fi
6012}
6013_iwlist ()
6014{
6015 local cur prev;
6016 COMPREPLY=();
6017 cur=`_get_cword`;
6018 prev=${COMP_WORDS[COMP_CWORD-1]};
6019 if [ $COMP_CWORD -eq 1 ]; then
6020 if [[ "$cur" == -* ]]; then
6021 COMPREPLY=($( compgen -W '--help --version' -- $cur ));
6022 else
6023 _available_interfaces -w;
6024 fi;
6025 else
6026 COMPREPLY=($( compgen -W 'scan scanning freq frequency \
6027 channel rate bit bitrate key enc encryption power \
6028 txpower retry ap accesspoint peers event' -- $cur ));
6029 fi
6030}
6031_iwpriv ()
6032{
6033 local cur prev;
6034 COMPREPLY=();
6035 cur=`_get_cword`;
6036 prev=${COMP_WORDS[COMP_CWORD-1]};
6037 case "$prev" in
6038 roam)
6039 COMPREPLY=($( compgen -W 'on off' -- $cur ));
6040 return 0
6041 ;;
6042 port)
6043 COMPREPLY=($( compgen -W 'ad-hoc managed' -- $cur ));
6044 return 0
6045 ;;
6046 esac;
6047 if [ $COMP_CWORD -eq 1 ]; then
6048 if [[ "$cur" == -* ]]; then
6049 COMPREPLY=($( compgen -W '--help --version' -- $cur ));
6050 else
6051 _available_interfaces -w;
6052 fi;
6053 else
6054 COMPREPLY=($( compgen -W '--all roam port' -- $cur ));
6055 fi
6056}
6057_iwspy ()
6058{
6059 local cur;
6060 COMPREPLY=();
6061 cur=`_get_cword`;
6062 if [ $COMP_CWORD -eq 1 ]; then
6063 if [[ "$cur" == -* ]]; then
6064 COMPREPLY=($( compgen -W '--help --version' -- $cur ));
6065 else
6066 _available_interfaces -w;
6067 fi;
6068 else
6069 COMPREPLY=($( compgen -W 'setthr getthr off' -- $cur ));
6070 fi
6071}
6072_jar ()
6073{
6074 local cur;
6075 COMPREPLY=();
6076 cur=`_get_cword`;
6077 if [ $COMP_CWORD = 1 ]; then
6078 COMPREPLY=($( compgen -W 'c t x u' -- $cur ));
6079 return 0;
6080 fi;
6081 case "${COMP_WORDS[1]}" in
6082 *c*f)
6083 _filedir
6084 ;;
6085 *f)
6086 _filedir '?([ejw]ar|zip|[EJW]AR|ZIP)'
6087 ;;
6088 *)
6089 _filedir
6090 ;;
6091 esac
6092}
6093_java ()
6094{
6095 local cur prev i;
6096 COMPREPLY=();
6097 cur=`_get_cword`;
6098 prev=${COMP_WORDS[COMP_CWORD-1]};
6099 for ((i=1; i < $COMP_CWORD; i++))
6100 do
6101 case ${COMP_WORDS[$i]} in
6102 -cp | -classpath)
6103 ((i++))
6104 ;;
6105 -*)
6106
6107 ;;
6108 *)
6109 _filedir;
6110 return 0
6111 ;;
6112 esac;
6113 done;
6114 case $prev in
6115 -@(cp|classpath))
6116 _java_path;
6117 return 0
6118 ;;
6119 esac;
6120 if [[ "$cur" == -* ]]; then
6121 COMPREPLY=($( compgen -W '-client -hotspot -server -classic \
6122 -cp -classpath -D -verbose -verbose:class \
6123 -verbose:gc -version:jni -version \
6124 -showversion -? -help -X -jar \
6125 -ea -enableassertions -da -disableassertions \
6126 -esa -enablesystemassertions \
6127 -dsa -disablesystemassertions ' -- $cur ));
6128 else
6129 if [[ "$prev" == -jar ]]; then
6130 _filedir jar;
6131 else
6132 _java_classes;
6133 fi;
6134 fi
6135}
6136_java_classes ()
6137{
6138 local classpath i;
6139 _java_find_classpath;
6140 cur=${cur//.//};
6141 for i in ${classpath//:/ };
6142 do
6143 if [ -r $i ] && [[ "$i" == *.@(jar|zip) ]]; then
6144 if type zipinfo &>/dev/null; then
6145 COMPREPLY=("${COMPREPLY[@]}" $( zipinfo -1 "$i" | grep "^$cur" | grep '\.class$' | grep -v "\\$" ));
6146 else
6147 COMPREPLY=("${COMPREPLY[@]}" $( jar tf "$i" "$cur" | grep "\.class$" | grep -v "\\$" ));
6148 fi;
6149 else
6150 if [ -d $i ]; then
6151 i=${i%/};
6152 COMPREPLY=("${COMPREPLY[@]}" $( find "$i" -type f -maxdepth 1 -path "$i/$cur*.class" 2>/dev/null | grep -v "\\$" | sed -e "s|^$i/||" ));
6153 fi;
6154 fi;
6155 done;
6156 COMPREPLY=(${COMPREPLY[@]%.class});
6157 COMPREPLY=(${COMPREPLY[@]//\//.})
6158}
6159_java_find_classpath ()
6160{
6161 local i;
6162 for ((i=1; i < COMP_CWORD; i++ ))
6163 do
6164 if [[ "${COMP_WORDS[i]}" == -@(cp|classpath) ]]; then
6165 classpath=${COMP_WORDS[i+1]};
6166 break;
6167 fi;
6168 done;
6169 [ -z "$classpath" ] && classpath=$CLASSPATH;
6170 [ -z "$classpath" ] && classpath=.
6171}
6172_java_find_sourcepath ()
6173{
6174 local i;
6175 for ((i=1; i < COMP_CWORD; i++ ))
6176 do
6177 if [[ "${COMP_WORDS[i]}" == -sourcepath ]]; then
6178 sourcepath=${COMP_WORDS[i+1]};
6179 break;
6180 fi;
6181 done;
6182 if [ -z "$sourcepath" ]; then
6183 _java_find_classpath;
6184 sourcepath=$classpath;
6185 fi
6186}
6187_java_packages ()
6188{
6189 local sourcepath i;
6190 _java_find_sourcepath;
6191 cur=${cur//.//};
6192 for i in ${sourcepath//:/ };
6193 do
6194 if [ -d $i ]; then
6195 COMPREPLY=("${COMPREPLY[@]}" $( command ls -F -d $i/$cur* 2>/dev/null | sed -e 's|^'$i'/||' ));
6196 fi;
6197 done;
6198 COMPREPLY=($( echo "${COMPREPLY[@]}" | tr " " "\n" | grep "/$" ));
6199 COMPREPLY=(${COMPREPLY[@]%/});
6200 cur=${COMPREPLY[@]//\//.}
6201}
6202_java_path ()
6203{
6204 cur=${cur##*:};
6205 _filedir '@(jar|zip)'
6206}
6207_javac ()
6208{
6209 COMPREPLY=();
6210 local cur prev;
6211 cur=`_get_cword`;
6212 prev=${COMP_WORDS[COMP_CWORD-1]};
6213 case $prev in
6214 -d)
6215 _filedir -d;
6216 return 0
6217 ;;
6218 -@(classpath|bootclasspath|sourcepath|extdirs))
6219 _java_path;
6220 return 0
6221 ;;
6222 esac;
6223 if [[ "$cur" == -* ]]; then
6224 COMPREPLY=($( compgen -W '-g -g:none -g:lines -g:vars\
6225 -g:source -O -nowarn -verbose -deprecation -classpath\
6226 -sourcepath -bootclasspath -extdirs -d -encoding -source\
6227 -target -help' -- $cur ));
6228 else
6229 _filedir java;
6230 fi
6231}
6232_javadoc ()
6233{
6234 COMPREPLY=();
6235 local cur prev;
6236 cur=`_get_cword`;
6237 prev=${COMP_WORDS[COMP_CWORD-1]};
6238 case $prev in
6239 -@(overview|helpfile|stylesheetfile))
6240 _filedir;
6241 return 0
6242 ;;
6243 -d)
6244 _filedir -d;
6245 return 0
6246 ;;
6247 -@(classpath|bootclasspath|docletpath|sourcepath|extdirs))
6248 _java_path;
6249 return 0
6250 ;;
6251 esac;
6252 if [[ "$cur" == -* ]]; then
6253 COMPREPLY=($( compgen -W '-overview -public -protected \
6254 -package -private -help -doclet -docletpath \
6255 -sourcepath -classpath -exclude -subpackages \
6256 -breakiterator -bootclasspath -source -extdirs \
6257 -verbose -locale -encoding -J -d -use -version \
6258 -author -docfilessubdirs -splitindex \
6259 -windowtitle -doctitle -header -footer -bottom \
6260 -link -linkoffline -excludedocfilessubdir \
6261 -group -nocomment -nodeprecated -noqualifier \
6262 -nosince -nodeprecatedlist -notree -noindex \
6263 -nohelp -nonavbar -quiet -serialwarn -tag \
6264 -taglet -tagletpath -charset -helpfile \
6265 -linksource -stylesheetfile -docencoding' -- $cur ));
6266 else
6267 _filedir java;
6268 _java_packages;
6269 fi
6270}
6271_kernel_versions ()
6272{
6273 COMPREPLY=($( command ls /lib/modules | grep "^$cur" ))
6274}
6275_kill ()
6276{
6277 local cur;
6278 COMPREPLY=();
6279 cur=`_get_cword`;
6280 if [ $COMP_CWORD -eq 1 ] && [[ "$cur" == -* ]]; then
6281 _signals;
6282 else
6283 _pids;
6284 fi
6285}
6286_killall ()
6287{
6288 local cur;
6289 COMPREPLY=();
6290 cur=`_get_cword`;
6291 if [ $COMP_CWORD -eq 1 ] && [[ "$cur" == -* ]]; then
6292 _signals;
6293 else
6294 _pnames;
6295 fi;
6296 return 0
6297}
6298_known_hosts ()
6299{
6300 local configfile;
6301 local cur curd ocur user suffix aliases global_kh user_kh hosts i host;
6302 local -a kh khd config;
6303 COMPREPLY=();
6304 cur=`_get_cword`;
6305 ocur=$cur;
6306 local OPTIND=1;
6307 while getopts "acF:" flag "$@"; do
6308 case $flag in
6309 a)
6310 aliases='yes'
6311 ;;
6312 c)
6313 suffix=':'
6314 ;;
6315 F)
6316 configfile="$OPTARG"
6317 ;;
6318 esac;
6319 done;
6320 [[ $cur == *@* ]] && user=${cur%@*}@ && cur=${cur#*@};
6321 kh=();
6322 if [ -n "$configfile" ]; then
6323 [ -r "$configfile" ] && config=("${config[@]}" "$configfile");
6324 else
6325 [ -r /etc/ssh/ssh_config ] && config=("${config[@]}" "/etc/ssh/ssh_config");
6326 [ -r "${HOME}/.ssh/config" ] && config=("${config[@]}" "${HOME}/.ssh/config");
6327 [ -r "${HOME}/.ssh2/config" ] && config=("${config[@]}" "${HOME}/.ssh2/config");
6328 fi;
6329 if [ ${#config[@]} -gt 0 ]; then
6330 global_kh=$( eval echo "$( sed -ne 's/^[ \t]*[Gg][Ll][Oo][Bb][Aa][Ll][Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee]['"$'\t '"']*\(.*\)$/\1/p' "${config[@]}" )" );
6331 user_kh=$( eval echo "$( sed -ne 's/^[ \t]*[Uu][Ss][Ee][Rr][Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee]['"$'\t '"']*\(.*\)$/\1/p' "${config[@]}" )" );
6332 fi;
6333 [ -r "$global_kh" ] && kh=("${kh[@]}" "$global_kh");
6334 if [ -z "$configfile" ]; then
6335 [ -r /etc/ssh/ssh_known_hosts ] && kh=("${kh[@]}" /etc/ssh/ssh_known_hosts);
6336 [ -r /etc/ssh/ssh_known_hosts2 ] && kh=("${kh[@]}" /etc/ssh/ssh_known_hosts2);
6337 [ -r /etc/known_hosts ] && kh=("${kh[@]}" /etc/known_hosts);
6338 [ -r /etc/known_hosts2 ] && kh=("${kh[@]}" /etc/known_hosts2);
6339 [ -d /etc/ssh2/knownhosts ] && khd=("${khd[@]}" /etc/ssh2/knownhosts/*pub);
6340 fi;
6341 [ -r "$user_kh" ] && kh=("${kh[@]}" "$user_kh");
6342 if [ -z "$configfile" ]; then
6343 [ -r ~/.ssh/known_hosts ] && kh=("${kh[@]}" ~/.ssh/known_hosts);
6344 [ -r ~/.ssh/known_hosts2 ] && kh=("${kh[@]}" ~/.ssh/known_hosts2);
6345 [ -d ~/.ssh2/hostkeys ] && khd=("${khd[@]}" ~/.ssh2/hostkeys/*pub);
6346 fi;
6347 if [ ${#kh[@]} -gt 0 -o ${#khd[@]} -gt 0 -o -n "$configfile" ]; then
6348 cur=${cur//\//\\\/};
6349 cur=${cur//\./\\\.};
6350 curd=$cur;
6351 if [[ "$cur" == [0-9]*.* ]]; then
6352 cur="^$cur.*";
6353 else
6354 if [[ "$cur" == [0-9]* ]]; then
6355 cur="^$cur.*\.";
6356 else
6357 if [ -z "$cur" ]; then
6358 cur="[a-z.]";
6359 else
6360 cur="^$cur";
6361 fi;
6362 fi;
6363 fi;
6364 if [ ${#kh[@]} -gt 0 ]; then
6365 COMPREPLY=($( awk 'BEGIN {FS=","}
6366 /^\s*[^|\#]/ {for (i=1; i<=2; ++i) { \
6367 gsub(" .*$", "", $i); \
6368 if ($i ~ /'$cur'/) {print $i} \
6369 }}' "${kh[@]}" 2>/dev/null ));
6370 fi;
6371 if [ ${#khd[@]} -gt 0 ]; then
6372 for i in "${khd[@]}";
6373 do
6374 if [[ "$i" == *key_22_$curd*.pub ]] && [ -r "$i" ]; then
6375 host=${i/#*key_22_/};
6376 host=${host/%.pub/};
6377 COMPREPLY=("${COMPREPLY[@]}" $host);
6378 fi;
6379 done;
6380 fi;
6381 if [ ${#config[@]} -gt 0 ] && [ -n "$aliases" ]; then
6382 local host_aliases=$( sed -ne 's/^[ \t]*[Hh][Oo][Ss][Tt]\([Nn][Aa][Mm][Ee]\)\?['"$'\t '"']\+\([^#*?]*\)\(#.*\)\?$/\2/p' "${config[@]}" );
6383 hosts=$( compgen -W "$host_aliases" -- $ocur );
6384 COMPREPLY=("${COMPREPLY[@]}" $hosts);
6385 fi;
6386 COMPREPLY=("${COMPREPLY[@]}" $( compgen -A hostname -- $ocur ));
6387 for ((i=0; i < ${#COMPREPLY[@]}; i++ ))
6388 do
6389 COMPREPLY[i]=$user${COMPREPLY[i]}$suffix;
6390 done;
6391 else
6392 if [ -z "$configfile" ]; then
6393 COMPREPLY=($( compgen -A hostname -S "$suffix" -- $cur ));
6394 fi;
6395 fi;
6396 return 0
6397}
6398_larch ()
6399{
6400 local cur prev;
6401 COMPREPLY=();
6402 cur=`_get_cword`;
6403 prev=${COMP_WORDS[COMP_CWORD-1]};
6404 if [ $COMP_CWORD -eq 1 ] || [[ "$prev" == -* ]]; then
6405 COMPREPLY=($( compgen -W ' \
6406my-id my-default-archive register-archive whereis-archive archives \
6407init-tree tree-root tree-version set-tree-version inventory tagging-method \
6408tree-lint missing-tags add delete move explicit-default set-manifest \
6409manifest check-manifest mkpatch dopatch patch-report empty-patch \
6410make-archive make-category make-branch make-version categories \
6411branches versions revisions cat-archive-log archive-cache-revision \
6412archive-cached-revisions archive-uncache-revision category-readme \
6413branch-readme version-readme make-log logs add-log log-ls cat-log \
6414log-header-field changelog log-for-merge merge-points new-on-branch \
6415import commit get get-patch lock-branch lock-revision push-mirror \
6416build-config update-config replay-config record-config show-config \
6417config-history update replay delta-patch star-merge tag prepare-branch \
6418finish-branch join-branch whats-missing what-changed file-diffs pristines \
6419lock-pristine my-revision-library library-find library-add library-remove \
6420library-archives library-categories library-branches library-versions \
6421library-revisions library-log library-file touched-files-prereqs \
6422patch-set-web update-distributions distribution-name notify my-notifier \
6423mail-new-categories mail-new-branches mail-new-versions mail-new-revisions \
6424notify-library notify-browser push-new-revisions sendmail-mailx' $cur ));
6425 fi;
6426 return 0
6427}
6428_lisp ()
6429{
6430 local cur;
6431 COMPREPLY=();
6432 cur=`_get_cword`;
6433 if [[ "$cur" == -* ]]; then
6434 COMPREPLY=($( compgen -W '-core -lib -batch -quit -edit -eval -init \
6435 -dynamic-space-size -hinit -noinit -nositeinit -load \
6436 -slave ' -- $cur ));
6437 else
6438 _filedir;
6439 fi;
6440 return 0
6441}
6442_list_admins ()
6443{
6444 local cur;
6445 COMPREPLY=();
6446 cur=`_get_cword`;
6447 if [[ "$cur" == -* ]]; then
6448 COMPREPLY=($( compgen -W '--all-vhost= -v \
6449 --all -a -h --help' -- $cur ));
6450 else
6451 _mailman_lists;
6452 fi
6453}
6454_list_lists ()
6455{
6456 local cur;
6457 COMPREPLY=();
6458 cur=`_get_cword`;
6459 if [[ "$cur" == -* ]]; then
6460 COMPREPLY=($( compgen -W '-a --advertised \
6461 --virtual-host-overview= -V -b --bare \
6462 -h --help' -- $cur ));
6463 fi
6464}
6465_list_members ()
6466{
6467 local cur prev;
6468 COMPREPLY=();
6469 cur=`_get_cword`;
6470 prev=${COMP_WORDS[COMP_CWORD-1]};
6471 case "$prev" in
6472 -@(o|-output))
6473 _filedir;
6474 return 0
6475 ;;
6476 -@(d|-digest=))
6477 COMPREPLY=($( compgen -W 'mime plain' -- $cur));
6478 return 0
6479 ;;
6480 -@(n|-nomail=))
6481 COMPREPLY=($( compgen -W 'byadmin byuser bybounce unknown' -- $cur));
6482 return 0
6483 ;;
6484 esac;
6485 if [[ "$cur" == -* ]]; then
6486 COMPREPLY=($( compgen -W '--output -o --regular -r \
6487 --digest= -d --nomail= -n --fullnames -f \
6488 --preserve -p -h --help' -- $cur ));
6489 else
6490 _mailman_lists;
6491 fi
6492}
6493_list_owners ()
6494{
6495 local cur;
6496 COMPREPLY=();
6497 cur=`_get_cword`;
6498 if [[ "$cur" == -* ]]; then
6499 COMPREPLY=($( compgen -W '-w --with-listnames \
6500 -m --moderators -h --help' -- $cur ));
6501 else
6502 _mailman_lists;
6503 fi
6504}
6505_longopt ()
6506{
6507 local cur opt;
6508 cur=`_get_cword`;
6509 if [[ "$cur" == --*=* ]]; then
6510 opt=${cur%%=*};
6511 opt=${opt%\\*};
6512 cur=${cur#*=};
6513 _filedir;
6514 COMPREPLY=($( compgen -P "$opt=" -W '${COMPREPLY[@]}' -- $cur));
6515 return 0;
6516 fi;
6517 if [[ "$cur" == -* ]]; then
6518 COMPREPLY=($( $1 --help 2>&1 | sed -e '/--/!d' -e 's/.*\(--[-A-Za-z0-9]\+=\?\).*/\1/' | command grep "^$cur" | sort -u ));
6519 else
6520 if [[ "$1" == rmdir ]]; then
6521 _filedir -d;
6522 else
6523 _filedir;
6524 fi;
6525 fi
6526}
6527_look ()
6528{
6529 local cur;
6530 COMPREPLY=();
6531 cur=`_get_cword`;
6532 if [ $COMP_CWORD = 1 ]; then
6533 COMPREPLY=($( compgen -W '$(look $cur 2>/dev/null)' ));
6534 fi
6535}
6536_lzma ()
6537{
6538 local cur prev xspec;
6539 COMPREPLY=();
6540 cur=`_get_cword`;
6541 prev=${COMP_WORDS[COMP_CWORD-1]};
6542 if [[ "$cur" == -* ]]; then
6543 COMPREPLY=($( compgen -W '-c -d -f -h -k -L -q -s \
6544 -v -V -z -1 -2 -3 -4 -5 -6 -7 -8 -9 \
6545 --help --decompress --compress --keep --force \
6546 --test --stdout --quiet --verbose --license \
6547 --version --small --fast --best --text' -- $cur ));
6548 return 0;
6549 fi;
6550 local IFS='
6551';
6552 xspec="*.lzma";
6553 if [[ "$prev" == --* ]]; then
6554 [[ "$prev" == --decompress || "$prev" == --list || "$prev" == --test ]] && xspec="!"$xspec;
6555 [[ "$prev" == --compress ]] && xspec=;
6556 else
6557 if [[ "$prev" == -* ]]; then
6558 [[ "$prev" == -*[dt]* ]] && xspec="!"$xspec;
6559 [[ "$prev" == -*z* ]] && xspec=;
6560 fi;
6561 fi;
6562 _expand || return 0;
6563 COMPREPLY=($( compgen -f -X "$xspec" -- $cur ) $( compgen -d -- $cur ))
6564}
6565_macof ()
6566{
6567 local cur;
6568 COMPREPLY=();
6569 cur=`_get_cword`;
6570 prev=${COMP_WORDS[COMP_CWORD-1]};
6571 case "$prev" in
6572 -i)
6573 _interfaces;
6574 return 0
6575 ;;
6576 esac;
6577 if [[ "$cur" == -* ]]; then
6578 COMPREPLY=($( compgen -W '-i -s -d -e -x -y -n' -- $cur ));
6579 fi
6580}
6581_mailman_lists ()
6582{
6583 COMPREPLY=($( list_lists -b | grep "^$cur"))
6584}
6585_mailmanctl ()
6586{
6587 local cur;
6588 COMPREPLY=();
6589 cur=`_get_cword`;
6590 if [[ "$cur" == -* ]]; then
6591 COMPREPLY=($( compgen -W '-n --no-restart -u --run-as-user \
6592 -s --stale-lock-cleanup --quiet -q -h --help' -- $cur ));
6593 else
6594 COMPREPLY=($( compgen -W 'start stop restart reopen' -- $cur ));
6595 fi
6596}
6597_make ()
6598{
6599 local file makef makef_dir="." makef_inc cur prev i;
6600 COMPREPLY=();
6601 cur=`_get_cword`;
6602 prev=${COMP_WORDS[COMP_CWORD-1]};
6603 case $prev in
6604 -@(f|o|W))
6605 _filedir;
6606 return 0
6607 ;;
6608 -@(I|C))
6609 _filedir -d;
6610 return 0
6611 ;;
6612 esac;
6613 if [[ "$cur" == *=* ]]; then
6614 prev=${cur/=*/};
6615 cur=${cur/*=/};
6616 case "$prev" in
6617 --@(file|makefile))
6618 _filedir;
6619 return 0
6620 ;;
6621 --@(directory|include-dir))
6622 _filedir -d;
6623 return 0
6624 ;;
6625 esac;
6626 fi;
6627 if [[ "$cur" == -* ]]; then
6628 COMPREPLY=($( compgen -W '-b -m -B -C -d -e -f -h -i -I\
6629 -j -l -k -n -o -p -q -r -R - s -S -t -v -w -W \
6630 --always-make --directory= --debug \
6631 --environment-overrides --file= --makefile= --help \
6632 --ignore-errors --include-dir= --jobs --load-average \
6633 --max-load --keep-going --just-print --dry-run \
6634 --recon --old-file= --assume-old= --print-data-base \
6635 --question --no-builtin-rules --no-builtin-variables \
6636 --silent --quiet --no-keep-goind --stop --touch \
6637 --version --print-directory --no-print-directory \
6638 --what-if= --new-file= --assume-new= \
6639 --warn-undefined-variables' -- $cur ));
6640 else
6641 for ((i=0; i < ${#COMP_WORDS[@]}; i++ ))
6642 do
6643 if [[ ${COMP_WORDS[i]} == -C ]]; then
6644 eval makef_dir=${COMP_WORDS[i+1]};
6645 break;
6646 fi;
6647 done;
6648 for ((i=0; i < ${#COMP_WORDS[@]}; i++ ))
6649 do
6650 if [[ ${COMP_WORDS[i]} == -f ]]; then
6651 eval makef=${COMP_WORDS[i+1]};
6652 break;
6653 fi;
6654 done;
6655 [ -n "$makef" ] && makef="-f ${makef}";
6656 [ -n "$makef_dir" ] && makef_dir="-C ${makef_dir}";
6657 COMPREPLY=($( make -qp $makef $makef_dir 2>/dev/null | awk -F':' '/^[a-zA-Z0-9][^$#\/\t=]*:([^=]|$)/ \
6658 {split($1,A,/ /);for(i in A)print A[i]}' | command grep "^$cur" ));
6659 fi
6660}
6661_man ()
6662{
6663 local cur prev sect manpath manext mansect uname;
6664 manext="@([0-9lnp]|[0-9][px]|man)?(.@(gz|bz2|lzma))";
6665 mansect="@([0-9lnp]|[0-9][px])";
6666 COMPREPLY=();
6667 cur=`_get_cword`;
6668 prev=${COMP_WORDS[COMP_CWORD-1]};
6669 if [[ "$prev" == -l ]]; then
6670 _filedir $manext;
6671 return 0;
6672 fi;
6673 _expand || return 0;
6674 if [[ "$cur" == */* ]]; then
6675 _filedir $manext;
6676 return 0;
6677 fi;
6678 uname=$( uname -s );
6679 if [[ $uname == @(Linux|GNU|GNU/*|FreeBSD|Cygwin|CYGWIN_*) ]]; then
6680 manpath=$( manpath 2>/dev/null || command man --path );
6681 else
6682 manpath=$MANPATH;
6683 fi;
6684 if [ -z "$manpath" ]; then
6685 COMPREPLY=($( compgen -c -- $cur ));
6686 return 0;
6687 fi;
6688 [[ "$prev" == $mansect ]] && sect=$prev || sect='*';
6689 manpath=$manpath:;
6690 if [ -n "$cur" ]; then
6691 manpath="${manpath//://*man$sect/$cur* } ${manpath//://*cat$sect/$cur* }";
6692 else
6693 manpath="${manpath//://*man$sect/ } ${manpath//://*cat$sect/ }";
6694 fi;
6695 COMPREPLY=($( eval command ls "$manpath" 2>/dev/null ));
6696 COMPREPLY=(${COMPREPLY[@]##*/?(:)});
6697 COMPREPLY=(${COMPREPLY[@]%.@(gz|bz2|lzma)});
6698 COMPREPLY=($( compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}" ));
6699 if [[ "$prev" != $mansect ]]; then
6700 local start=${#COMPREPLY[@]};
6701 _filedir $manext;
6702 for ((i=$start; i < ${#COMPREPLY[@]}; i++ ))
6703 do
6704 [[ ${COMPREPLY[i]} == */* ]] || COMPREPLY[i]=./${COMPREPLY[i]};
6705 done;
6706 fi;
6707 return 0
6708}
6709_mc ()
6710{
6711 local cur prev;
6712 COMPREPLY=();
6713 cur=`_get_cword`;
6714 prev=${COMP_WORDS[COMP_CWORD-1]};
6715 case "$prev" in
6716 -@(e|v|l|P))
6717 _filedir;
6718 return 0
6719 ;;
6720 esac;
6721 if [[ "$cur" == *=* ]]; then
6722 prev=${cur/=*/};
6723 cur=${cur/*=/};
6724 case "$prev" in
6725 --@(edit|view|ftplog|printwd))
6726 _filedir;
6727 return 0
6728 ;;
6729 esac;
6730 fi;
6731 if [[ "$cur" == -* ]]; then
6732 COMPREPLY=($( compgen -W '-a --stickchars -b --nocolor -c \
6733 --color -C --colors= -d --nomouse -e --edit= -f \
6734 --datadir -k --resetsoft -l --ftplog= -P --printwd= \
6735 -s --slow -t --termcap -u --nosubshell -U --subshell \
6736 -v --view= -V --version -x --xterm -h --help' -- $cur ));
6737 else
6738 _filedir -d;
6739 fi
6740}
6741_mcrypt ()
6742{
6743 local cur prev i decrypt;
6744 COMPREPLY=();
6745 cur=`_get_cword`;
6746 prev=${COMP_WORDS[COMP_CWORD-1]};
6747 case "$prev" in
6748 -@(g|-openpgp-z))
6749 COMPREPLY=($( compgen -W '0 1 2 3 4 5 6 7 8 9' -- $cur ));
6750 return 0
6751 ;;
6752 -@(o|-keymode))
6753 COMPREPLY=($( mcrypt --list-keymodes 2> /dev/null |
6754 grep "^$cur" ));
6755 return 0
6756 ;;
6757 -@(m|-mode))
6758 COMPREPLY=($( mcrypt --list 2> /dev/null |
6759 sed -e 's/.*: //' -e 's/ $//' | sort |
6760 uniq | tr " " "\n" | grep "^$cur" ));
6761 return 0
6762 ;;
6763 -@(a|-algorithm))
6764 COMPREPLY=($( mcrypt --list 2> /dev/null |
6765 awk '{print $1}' | grep "^$cur" ));
6766 return 0
6767 ;;
6768 -@(h|-hash))
6769 COMPREPLY=($( mcrypt --list-hash 2> /dev/null |
6770 sed 1d | grep "^$cur" ));
6771 return 0
6772 ;;
6773 -@(k|s|-@(key?(size))))
6774 return 0
6775 ;;
6776 -@(f|c|-@(keyfile|config)))
6777 _filedir;
6778 return 0
6779 ;;
6780 --@(algorithm|mode)s-directory)
6781 _filedir -d;
6782 return 0
6783 ;;
6784 esac;
6785 if [[ "$cur" == -* ]]; then
6786 COMPREPLY=($( compgen -W '-g --openpgp --openpgp-z -d \
6787 --decrypt -s --keysize -o --keymode -f --keyfile \
6788 -c --config -a --algorithm --algorithms-directory \
6789 -m --mode --modes-directory -h --hash -k --key \
6790 --noiv -b --bare -z --gzip -p --bzip2 --flush -l \
6791 --doublecheck -u --unlink --nodelete -t --time -F \
6792 --force --echo -r --random --list --list-keymodes \
6793 --list-hash -V --verbose -q --quiet --help -v \
6794 --version -L --license' -- $cur ));
6795 else
6796 if [[ ${COMP_WORDS[0]} == mdecrypt ]]; then
6797 _filedir '@(nc)';
6798 else
6799 decrypt=0;
6800 for ((i=1; i < ${#COMP_WORDS[@]}-1; i++ ))
6801 do
6802 if [[ ${COMP_WORDS[i]} == -@(d|-decrypt) ]]; then
6803 _filedir '@(nc)';
6804 decrypt=1;
6805 break;
6806 fi;
6807 done;
6808 if [[ $decrypt -eq 0 ]]; then
6809 _filedir;
6810 fi;
6811 fi;
6812 fi
6813}
6814_mii_tool ()
6815{
6816 local cur prev;
6817 COMPREPLY=();
6818 cur=`_get_cword`;
6819 prev=${COMP_WORDS[COMP_CWORD-1]};
6820 case $prev in
6821 -F)
6822 COMPREPLY=($( compgen -W '100baseTx-FD 100baseTx-HD \
6823 10baseT-FD 10baseT-HD' -- $cur ));
6824 return 0
6825 ;;
6826 -A)
6827 COMPREPLY=($( compgen -W '100baseT4 100baseTx-FD 100baseTx-HD \
6828 10baseT-FD 10baseT-HD' -- $cur ));
6829 return 0
6830 ;;
6831 esac;
6832 if [[ "$cur" == *=* ]]; then
6833 prev=${cur/=*/};
6834 cur=${cur/*=/};
6835 case "$prev" in
6836 --force)
6837 COMPREPLY=($( compgen -W '100baseTx-FD \
6838 100baseTx-HD 10baseT-FD \
6839 10baseT-HD' -- $cur ));
6840 return 0
6841 ;;
6842 --advertise)
6843 COMPREPLY=($( compgen -W '100baseT4 \
6844 100baseTx-FD 100baseTx-HD 10baseT-FD \
6845 10baseT-HD' -- $cur ));
6846 return 0
6847 ;;
6848 esac;
6849 fi;
6850 if [[ "$cur" == -* ]]; then
6851 COMPREPLY=($( compgen -W '-v --verbose -V --version -R \
6852 --reset -r --restart -w --watch -l --log -A \
6853 --advertise= -F --force=' -- $cur ));
6854 else
6855 _available_interfaces -a;
6856 fi
6857}
6858_mmsitepass ()
6859{
6860 local cur;
6861 COMPREPLY=();
6862 cur=`_get_cword`;
6863 if [[ "$cur" == -* ]]; then
6864 COMPREPLY=($( compgen -W '-c --listcreator -h --help' -- $cur ));
6865 fi
6866}
6867_modules ()
6868{
6869 local modpath;
6870 modpath=/lib/modules/$1;
6871 COMPREPLY=($( command ls -R $modpath | sed -ne 's/^\('$cur'.*\)\.k\?o\(\|.gz\)$/\1/p'))
6872}
6873_mount ()
6874{
6875 local cur i sm host;
6876 COMPREPLY=();
6877 cur=`_get_cword`;
6878 [[ "$cur" == \\ ]] && cur="/";
6879 for i in {,/usr}/{,s}bin/showmount;
6880 do
6881 [ -x $i ] && sm=$i && break;
6882 done;
6883 if [ -n "$sm" ] && [[ "$cur" == *:* ]]; then
6884 COMPREPLY=($( $sm -e ${cur%%:*} | sed 1d | grep ^${cur#*:} | awk '{print $1}' ));
6885 else
6886 if [[ "$cur" == //* ]]; then
6887 host=${cur#//};
6888 host=${host%%/*};
6889 if [ -n "$host" ]; then
6890 COMPREPLY=($( compgen -W "$( echo $( smbclient -d 0 -NL $host 2>/dev/null|
6891 sed -ne '/^['"$'\t '"']*Sharename/,/^$/p' |
6892 sed -ne '3,$s|^[^A-Za-z]*\([^'"$'\t '"']*\).*$|//'$host'/\1|p' ) )" -- "$cur" ));
6893 fi;
6894 else
6895 if [ -r /etc/vfstab ]; then
6896 COMPREPLY=($( awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}' /etc/vfstab | grep "^$cur" ));
6897 else
6898 if [ ! -e /etc/fstab ]; then
6899 COMPREPLY=($( mount | awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}' | grep "^$cur" ));
6900 else
6901 COMPREPLY=($( awk '! /^[ \t]*#/ {if ($2 ~ /\//) print $2}' /etc/fstab | grep "^$cur" ));
6902 fi;
6903 fi;
6904 fi;
6905 fi;
6906 return 0
6907}
6908_newlist ()
6909{
6910 local cur;
6911 COMPREPLY=();
6912 cur=`_get_cword`;
6913 if [[ "$cur" == -* ]]; then
6914 COMPREPLY=($( compgen -W '-l --language -q --quiet -h --help' -- $cur ));
6915 else
6916 _mailman_lists;
6917 fi
6918}
6919_nslookup ()
6920{
6921 local cur;
6922 COMPREPLY=();
6923 cur=${COMP_WORDS[COMP_CWORD]#-};
6924 COMPREPLY=($( compgen -P '-' -W 'all class= debug d2 domain= \
6925 srchlist= defname search port= querytype= \
6926 type= recurse retry root timeout vc \
6927 ignoretc' -- $cur ))
6928}
6929_ntpdate ()
6930{
6931 local cur prev;
6932 COMPREPLY=();
6933 cur=`_get_cword`;
6934 prev=${COMP_WORDS[COMP_CWORD-1]};
6935 case $prev in
6936 -k)
6937 _filedir;
6938 return 0
6939 ;;
6940 -U)
6941 COMPREPLY=($( compgen -u $cur ));
6942 return 0
6943 ;;
6944 esac;
6945 if [[ "$cur" == -* ]]; then
6946 COMPREPLY=($( compgen -W '-4 -6 -b -B -d -Q -q -s -u -v -a\
6947 -e -k -p -o -r -t' -- $cur ));
6948 else
6949 _known_hosts;
6950 fi
6951}
6952_openssl ()
6953{
6954 local cur prev;
6955 COMPREPLY=();
6956 cur=`_get_cword`;
6957 if [ $COMP_CWORD -eq 1 ]; then
6958 COMPREPLY=($( compgen -W 'asn1parse ca ciphers crl crl2pkcs7 \
6959 dgst dh dhparam dsa dsaparam enc errstr gendh gendsa \
6960 genrsa nseq passwd pkcs12 pkcs7 pkcs8 rand req rsa \
6961 rsautl s_client s_server s_time sess_id smime speed \
6962 spkac verify version x509 md2 md4 md5 mdc2 rmd160 sha \
6963 sha1 base64 bf bf-cbc bf-cfb bf-ecb bf-ofb cast \
6964 cast-cbc cast5-cbc cast5-cfb cast5-ecb cast5-ofb des \
6965 des-cbc des-cfb des-ecb des-ede des-ede-cbc \
6966 des-ede-cfb des-ede-ofb des-ede3 des-ede3-cbc \
6967 des-ede3-cfb des-ede3-ofb des-ofb des3 desx rc2 \
6968 rc2-40-cbc rc2-64-cbc rc2-cbc rc2-cfb rc2-ecb rc2-ofb \
6969 rc4 rc4-40' -- $cur ));
6970 else
6971 prev=${COMP_WORDS[COMP_CWORD-1]};
6972 case ${COMP_WORDS[1]} in
6973 asn1parse)
6974 case $prev in
6975 -inform)
6976 COMPREPLY=($( compgen -W 'DER PEM' -- $cur ));
6977 return 0
6978 ;;
6979 -@(in|out|oid))
6980 _filedir;
6981 return 0
6982 ;;
6983 esac;
6984 if [[ "$cur" == -* ]]; then
6985 COMPREPLY=($( compgen -W '-inform -in -out -noout -offset \
6986 -length -i -oid -strparse' -- $cur ));
6987 fi
6988 ;;
6989 ca)
6990 case $prev in
6991 -@(config|revoke|cert|in|out|spkac|ss_cert))
6992 _filedir;
6993 return 0
6994 ;;
6995 -outdir)
6996 _filedir -d;
6997 return 0
6998 ;;
6999 -@(name|crlexts|extensions))
7000 _openssl_sections;
7001 return 0
7002 ;;
7003 esac;
7004 if [[ "$cur" == -* ]]; then
7005 COMPREPLY=($( compgen -W '-verbose -config -name \
7006 -gencrl -revoke -crldays -crlhours -crlexts \
7007 -startdate -enddate -days -md -policy -keyfile \
7008 -key -passin -cert -in -out -notext -outdir \
7009 -infiles -spkac -ss_cert -preserveDN -batch \
7010 -msie_hack -extensions' -- $cur ));
7011 fi
7012 ;;
7013 ciphers)
7014 if [[ "$cur" == -* ]]; then
7015 COMPREPLY=($( compgen -W '-v -ssl2 -ssl3 -tls1' -- $cur ));
7016 fi
7017 ;;
7018 crl)
7019 case $prev in
7020 -@(in|out)form)
7021 COMPREPLY=($( compgen -W 'DER PEM' -- $cur ));
7022 return 0
7023 ;;
7024 -@(in|out|CAfile))
7025 _filedir;
7026 return 0
7027 ;;
7028 -CAPath)
7029 _filedir -d;
7030 return 0
7031 ;;
7032 esac;
7033 if [[ "$cur" == -* ]]; then
7034 COMPREPLY=($( compgen -W '-inform -outform -text -in -out -noout \
7035 -hash -issuer -lastupdate -nextupdate -CAfile -CApath' -- $cur ));
7036 fi
7037 ;;
7038 crl2pkcs7)
7039 case $prev in
7040 -@(in|out)form)
7041 COMPREPLY=($( compgen -W 'DER PEM' -- $cur ));
7042 return 0
7043 ;;
7044 -@(in|out))
7045 _filedir;
7046 return 0
7047 ;;
7048 esac;
7049 if [[ "$cur" == -* ]]; then
7050 COMPREPLY=($( compgen -W '-inform -outform -in -out -print_certs' -- $cur ));
7051 fi
7052 ;;
7053 dgst)
7054 case $prev in
7055 -@(out|sign|verify|prvrify|signature))
7056 _filedir;
7057 return 0
7058 ;;
7059 esac;
7060 if [[ "$cur" == -* ]]; then
7061 COMPREPLY=($( compgen -W '-md5 -md4 -md2 -sha1 -sha -mdc2 -ripemd160 -dss1 \
7062 -c -d -hex -binary -out -sign -verify -prverify -signature' -- $cur ));
7063 else
7064 _filedir;
7065 fi
7066 ;;
7067 dsa)
7068 case $prev in
7069 -@(in|out)form)
7070 COMPREPLY=($( compgen -W 'DER PEM' -- $cur ));
7071 return 0
7072 ;;
7073 -@(in|out))
7074 _filedir;
7075 return 0
7076 ;;
7077 esac;
7078 if [[ "$cur" == -* ]]; then
7079 COMPREPLY=($( compgen -W '-inform -outform -in -passin -out -passout -des -des3 -idea -text -noout \
7080 -modulus -pubin -pubout' -- $cur ));
7081 fi
7082 ;;
7083 dsaparam)
7084 case $prev in
7085 -@(in|out)form)
7086 COMPREPLY=($( compgen -W 'DER PEM' -- $cur ));
7087 return 0
7088 ;;
7089 -@(in|out|rand))
7090 _filedir;
7091 return 0
7092 ;;
7093 esac;
7094 if [[ "$cur" == -* ]]; then
7095 COMPREPLY=($( compgen -W '-inform -outform -in -out -noout \
7096 -text -C -rand -genkey' -- $cur ));
7097 fi
7098 ;;
7099 enc)
7100 case $prev in
7101 -@(in|out|kfile))
7102 _filedir;
7103 return 0
7104 ;;
7105 esac;
7106 if [[ "$cur" == -* ]]; then
7107 COMPREPLY=($( compgen -W '-ciphername -in -out -pass \
7108 -e -d -a -A -k -kfile -S -K -iv -p -P -bufsize -debug' -- $cur ));
7109 fi
7110 ;;
7111 dhparam)
7112 case $prev in
7113 -@(in|out)form)
7114 COMPREPLY=($( compgen -W 'DER PEM' -- $cur ));
7115 return 0
7116 ;;
7117 -@(in|out|rand))
7118 _filedir;
7119 return 0
7120 ;;
7121 esac;
7122 if [[ "$cur" == -* ]]; then
7123 COMPREPLY=($( compgen -W '-inform -outform -in -out -dsaparam -noout \
7124 -text -C -2 -5 -rand' -- $cur ));
7125 fi
7126 ;;
7127 gendsa)
7128 case $prev in
7129 -@(out|rand))
7130 _filedir;
7131 return 0
7132 ;;
7133 esac;
7134 if [[ "$cur" == -* ]]; then
7135 COMPREPLY=($( compgen -W '-out -des -des3 -idea -rand' -- $cur ));
7136 else
7137 _filedir;
7138 fi
7139 ;;
7140 genrsa)
7141 case $prev in
7142 -@(out|rand))
7143 _filedir;
7144 return 0
7145 ;;
7146 esac;
7147 if [[ "$cur" == -* ]]; then
7148 COMPREPLY=($( compgen -W '-out -passout -des -des3 -idea -f4 -3 -rand' -- $cur ));
7149 fi
7150 ;;
7151 pkcs7)
7152 case $prev in
7153 -@(in|out)form)
7154 COMPREPLY=($( compgen -W 'DER PEM' -- $cur ));
7155 return 0
7156 ;;
7157 -@(in|out))
7158 _filedir;
7159 return 0
7160 ;;
7161 esac;
7162 if [[ "$cur" == -* ]]; then
7163 COMPREPLY=($( compgen -W '-inform -outform -in -out -print_certs -text -noout' -- $cur ));
7164 fi
7165 ;;
7166 rand)
7167 case $prev in
7168 -@(out|rand))
7169 _filedir;
7170 return 0
7171 ;;
7172 esac;
7173 if [[ "$cur" == -* ]]; then
7174 COMPREPLY=($( compgen -W '-out -rand -base64' -- $cur ));
7175 fi
7176 ;;
7177 req)
7178 case "$prev" in
7179 -@(in|out|key)form)
7180 COMPREPLY=($( compgen -W 'DER PEM' -- $cur ));
7181 return 0
7182 ;;
7183 -@(in|out|rand|key|keyout|config))
7184 _filedir;
7185 return 0
7186 ;;
7187 -extensions)
7188 _openssl_sections;
7189 return 0
7190 ;;
7191 esac;
7192 if [[ "$cur" == -* ]]; then
7193 COMPREPLY=($( compgen -W '-inform -outform -in \
7194 -passin -out -passout -text -noout -verify \
7195 -modulus -new -rand -newkey -newkey -nodes \
7196 -key -keyform -keyout -md5 -sha1 -md2 -mdc2 \
7197 -config -x509 -days -asn1-kludge -newhdr \
7198 -extensions -reqexts section' -- $cur ));
7199 fi
7200 ;;
7201 rsa)
7202 case $prev in
7203 -@(in|out)form)
7204 COMPREPLY=($( compgen -W 'DER NET PEM' -- $cur ));
7205 return 0
7206 ;;
7207 -@(in|out))
7208 _filedir;
7209 return 0
7210 ;;
7211 esac;
7212 if [[ "$cur" == -* ]]; then
7213 COMPREPLY=($( compgen -W '-inform -outform -in -passin -out -passout \
7214 -sgckey -des -des3 -idea -text -noout -modulus -check -pubin \
7215 -pubout -engine' -- $cur ));
7216 fi
7217 ;;
7218 rsautl)
7219 case $prev in
7220 -@(in|out|inkey))
7221 _filedir;
7222 return 0
7223 ;;
7224 esac;
7225 if [[ "$cur" == -* ]]; then
7226 COMPREPLY=($( compgen -W '-in -out -inkey -pubin -certin -sign -verify \
7227 -encrypt -decrypt -pkcs -ssl -raw -hexdump -asn1parse' -- $cur ));
7228 fi
7229 ;;
7230 s_client)
7231 case $prev in
7232 -connect)
7233 _known_hosts;
7234 return 0
7235 ;;
7236 -@(cert|key|CAfile|rand))
7237 _filedir;
7238 return 0
7239 ;;
7240 -CApath)
7241 _filedir -d;
7242 return 0
7243 ;;
7244 esac;
7245 if [[ "$cur" == -* ]]; then
7246 COMPREPLY=($( compgen -W '-connect -verify -cert -key -CApath -CAfile \
7247 -reconnect -pause -showcerts -debug -msg -nbio_test -state -nbio \
7248 -crlf -ign_eof -quiet -ssl2 -ssl3 -tls1 -no_ssl2 -no_ssl3 -no_tls1 \
7249 -bugs -cipher -starttls -engine -rand' -- $cur ));
7250 fi
7251 ;;
7252 s_server)
7253 case $prev in
7254 -@(cert|key|dcert|dkey|dhparam|CAfile|rand))
7255 _filedir;
7256 return 0
7257 ;;
7258 -CApath)
7259 _filedir -d;
7260 return 0
7261 ;;
7262 esac;
7263 if [[ "$cur" == -* ]]; then
7264 COMPREPLY=($( compgen -W '-accept -context -verify -Verify -cert -key \
7265 -dcert -dkey -dhparam -nbio -nbio_test -crlf -debug -msg -state -CApath \
7266 -CAfile -nocert -cipher -quiet -no_tmp_rsa -ssl2 -ssl3 -tls1 -no_ssl2 \
7267 -no_ssl3 -no_tls1 -no_dhe -bugs -hack -www -WWW -HTTP -engine -id_prefix \
7268 -rand' -- $cur ));
7269 fi
7270 ;;
7271 s_time)
7272 case $prev in
7273 -connect)
7274 _known_hosts;
7275 return 0
7276 ;;
7277 -@(cert|key|CAfile))
7278 _filedir;
7279 return 0
7280 ;;
7281 -CApath)
7282 _filedir -d;
7283 return 0
7284 ;;
7285 esac;
7286 if [[ "$cur" == -* ]]; then
7287 COMPREPLY=($( compgen -W '-connect -www -cert -key -CApath -CAfile -reuse \
7288 -new -verify -nbio -time -ssl2 -ssl3 -bugs -cipher' -- $cur ));
7289 fi
7290 ;;
7291 sess_id)
7292 case $prev in
7293 -@(in|out)form)
7294 COMPREPLY=($( compgen -W 'DER PEM' -- $cur ));
7295 return 0
7296 ;;
7297 -@(in|out))
7298 _filedir;
7299 return 0
7300 ;;
7301 esac;
7302 if [[ "$cur" == -* ]]; then
7303 COMPREPLY=($( compgen -W '-inform -outform -in -out -text -noout \
7304 -context ID' -- $cur ));
7305 fi
7306 ;;
7307 smime)
7308 case $prev in
7309 -@(in|out)form)
7310 COMPREPLY=($( compgen -W 'SMIME DER PEM' -- $cur ));
7311 return 0
7312 ;;
7313 -@(in|out|certfile|signer|recip|inkey|content|rand))
7314 _filedir;
7315 return 0
7316 ;;
7317 esac;
7318 if [[ "$cur" == -* ]]; then
7319 COMPREPLY=($( compgen -W '-encrypt -decrypt -sign -verify -pk7out -des -des3 \
7320 -rc2-40 -rc2-64 -rc2-128 -aes128 -aes192 -aes256 -in -certfile -signer \
7321 -recip -inform -passin -inkey -out -outform -content -to -from -subject \
7322 -text -rand' -- $cur ));
7323 else
7324 _filedir;
7325 fi
7326 ;;
7327 speed)
7328 if [[ "$cur" == -* ]]; then
7329 COMPREPLY=($( compgen -W '-engine' -- $cur ));
7330 else
7331 COMPREPLY=($( compgen -W 'md2 mdc2 md5 hmac sha1 rmd160 idea-cbc \
7332 rc2-cbc rc5-cbc bf-cbc des-cbc des-ede3 rc4 rsa512 rsa1024 rsa2048 \
7333 rsa4096 dsa512 dsa1024 dsa2048 idea rc2 des rsa blowfish' -- $cur ));
7334 fi
7335 ;;
7336 verify)
7337 case $prev in
7338 -@(CAfile|untrusted))
7339 _filedir;
7340 return 0
7341 ;;
7342 -CApath)
7343 _filedir -d;
7344 return 0
7345 ;;
7346 esac;
7347 if [[ "$cur" == -* ]]; then
7348 COMPREPLY=($( compgen -W '-CApath -CAfile -purpose -untrusted -help -issuer_checks \
7349 -verbose -certificates' -- $cur ));
7350 else
7351 _filedir;
7352 fi
7353 ;;
7354 x509)
7355 case "$prev" in
7356 -@(in|out|CA|CAkey|CAserial|extfile))
7357 _filedir;
7358 return 0
7359 ;;
7360 -@(in|out)form)
7361 COMPREPLY=($( compgen -W 'DER PEM NET' -- $cur ));
7362 return 0
7363 ;;
7364 -@(key|CA|CAkey)form)
7365 COMPREPLY=($( compgen -W 'DER PEM' -- $cur ));
7366 return 0
7367 ;;
7368 -extensions)
7369 _openssl_sections;
7370 return 0
7371 ;;
7372 esac;
7373 if [[ "$cur" == -* ]]; then
7374 COMPREPLY=($( compgen -W '-inform -outform \
7375 -keyform -CAform -CAkeyform -in -out \
7376 -serial -hash -subject -issuer -nameopt \
7377 -email -startdate -enddate -purpose \
7378 -dates -modulus -fingerprint -alias \
7379 -noout -trustout -clrtrust -clrreject \
7380 -addtrust -addreject -setalias -days \
7381 -set_serial -signkey -x509toreq -req \
7382 -CA -CAkey -CAcreateserial -CAserial \
7383 -text -C -md2 -md5 -sha1 -mdc2 -clrext \
7384 -extfile -extensions -engine' -- $cur ));
7385 fi
7386 ;;
7387 @(md5|md4|md2|sha1|sha|mdc2|ripemd160))
7388 if [[ "$cur" == -* ]]; then
7389 COMPREPLY=($( compgen -W '-c -d' -- $cur ));
7390 else
7391 _filedir;
7392 fi
7393 ;;
7394 esac;
7395 fi;
7396 return 0
7397}
7398_openssl_sections ()
7399{
7400 local config;
7401 config=/etc/ssl/openssl.cnf;
7402 [ ! -f $config ] && config=/usr/share/ssl/openssl.cnf;
7403 for ((i=2; i < COMP_CWORD; i++ ))
7404 do
7405 if [[ "${COMP_WORDS[i]}" == -config ]]; then
7406 config=${COMP_WORDS[i+1]};
7407 break;
7408 fi;
7409 done;
7410 [ ! -f $config ] && return 0;
7411 COMPREPLY=($( awk '/\[.*\]/ {print $2} ' $config | grep "^$cur" ))
7412}
7413_p4 ()
7414{
7415 local cur prev prev2 p4commands p4filetypes;
7416 COMPREPLY=();
7417 cur=`_get_cword`;
7418 prev=${COMP_WORDS[COMP_CWORD-1]};
7419 p4commands="$( p4 help commands | awk 'NF>3 {print $1}' )";
7420 p4filetypes="ctext cxtext ktext kxtext ltext tempobj ubinary uresource uxbinary xbinary xltext xtempobj xtext text binary resource";
7421 if [ $COMP_CWORD -eq 1 ]; then
7422 COMPREPLY=($( compgen -W "$p4commands" -- $cur ));
7423 else
7424 if [ $COMP_CWORD -eq 2 ]; then
7425 case "$prev" in
7426 help)
7427 COMPREPLY=($( compgen -W "simple commands environment filetypes jobview revisions usage views $p4commands" -- $cur ))
7428 ;;
7429 admin)
7430 COMPREPLY=($( compgen -W "checkpoint stop" -- $cur ))
7431 ;;
7432 *)
7433
7434 ;;
7435 esac;
7436 else
7437 if [ $COMP_CWORD -gt 2 ]; then
7438 prev2=${COMP_WORDS[COMP_CWORD-2]};
7439 case "$prev" in
7440 -t)
7441 case "$prev2" in
7442 add | edit | reopen)
7443 COMPREPLY=($( compgen -W "$p4filetypes" -- $cur))
7444 ;;
7445 *)
7446
7447 ;;
7448 esac
7449 ;;
7450 *)
7451
7452 ;;
7453 esac;
7454 fi;
7455 fi;
7456 fi;
7457 return 0
7458}
7459_parse_help ()
7460{
7461 local cmd;
7462 cmd=$1;
7463 $cmd --help | grep --color=auto -- "^[[:space:]]*-" | tr "," " " | awk '{print $1; if ($2 ~ /-.*/) { print $2 } }' | sed -e "s:=.*::g"
7464}
7465_pci_ids ()
7466{
7467 COMPREPLY=(${COMPREPLY[@]:-} $( compgen -W "$( lspci -n | awk '{print $3}')" -- $cur ))
7468}
7469_perl ()
7470{
7471 local cur prev prefix temp;
7472 local optPrefix optSuffix;
7473 COMPREPLY=();
7474 cur=`_get_cword`;
7475 prev=${COMP_WORDS[COMP_CWORD-1]};
7476 prefix="";
7477 if [[ "$cur" == -?* ]]; then
7478 temp=$cur;
7479 prev=${temp:0:2};
7480 cur=${temp:2};
7481 optPrefix=-P$prev;
7482 optSuffix=-S/;
7483 prefix=$prev;
7484 fi;
7485 case "$prev" in
7486 -I | -x)
7487 local IFS='
7488';
7489 COMPREPLY=($( compgen -d $optPrefix $optSuffix -- "$cur" ));
7490 return 0
7491 ;;
7492 -m | -M)
7493 _perlmodules;
7494 return 0
7495 ;;
7496 esac;
7497 if [[ "$cur" == -* ]]; then
7498 COMPREPLY=($( compgen -W '-C -s -T -u -U -W -X -h -v -V -c -w -d \
7499 -D -p -n -a -F -l -0 -I -m -M -P -S -x -i -e ' -- $cur ));
7500 else
7501 _filedir;
7502 fi
7503}
7504_perldoc ()
7505{
7506 local cur prev prefix temp;
7507 COMPREPLY=();
7508 cur=`_get_cword`;
7509 prev=${COMP_WORDS[COMP_CWORD-1]};
7510 prefix="";
7511 if [[ "$cur" == -?* ]]; then
7512 temp=$cur;
7513 prev=${temp:0:2};
7514 cur=${temp:2};
7515 prefix=$prev;
7516 fi;
7517 case $prev in
7518 -f)
7519 COMPREPLY=($( compgen -W 'chomp chop chr crypt hex index lc \
7520 lcfirst length oct ord pack q qq reverse rindex sprintf \
7521 substr tr uc ucfirst y m pos quotemeta s split study qr abs \
7522 atan2 cos exp hex int log oct rand sin sqrt srand pop push \
7523 shift splice unshift grep join map qw reverse sort unpack \
7524 delete each exists keys values binmode close closedir \
7525 dbmclose dbmopen die eof fileno flock format getc print \
7526 printf read readdir rewinddir seek seekdir select syscall \
7527 sysread sysseek syswrite tell telldir truncate warn write \
7528 pack read syscall sysread syswrite unpack vec -X chdir chmod \
7529 chown chroot fcntl glob ioctl link lstat mkdir open opendir \
7530 readlink rename rmdir stat symlink umask unlink utime caller \
7531 continue do dump eval exit goto last next redo return \
7532 sub wantarray caller import local my our package use defined \
7533 formline reset scalar undef \
7534 alarm exec fork getpgrp getppid getpriority kill pipe qx \
7535 setpgrp setpriority sleep system times wait waitpid \
7536 import no package require use bless dbmclose dbmopen package \
7537 ref tie tied untie use accept bind connect getpeername \
7538 getsockname getsockopt listen recv send setsockopt shutdown \
7539 socket socketpair msgctl msgget msgrcv msgsnd semctl semget \
7540 semop shmctl shmget shmread shmwrite endgrent endhostent \
7541 endnetent endpwent getgrent getgrgid getgrnam getlogin \
7542 getpwent getpwnam getpwuid setgrent setpwent endprotoent \
7543 endservent gethostbyaddr gethostbyname gethostent \
7544 getnetbyaddr getnetbyname getnetent getprotobyname \
7545 getprotobynumber getprotoent getservbyname getservbyport \
7546 getservent sethostent setnetent setprotoent setservent \
7547 gmtime localtime time times' -- $cur ));
7548 return 0
7549 ;;
7550 esac;
7551 if [[ "$cur" == -* ]]; then
7552 COMPREPLY=($( compgen -W '-h -v -t -u -m -l -F -X -f -q' -- $cur ));
7553 else
7554 if [[ "$cur" != */* ]]; then
7555 _perlmodules;
7556 COMPREPLY=("${COMPREPLY[@]}" $( compgen -W '$( PAGER=/bin/cat man perl | sed -ne "/perl.*Perl overview/,/perlwin32/p" | awk "\$NF=2 { print \$1}" | grep perl )' -- $cur ));
7557 fi;
7558 fi
7559}
7560_perlmodules ()
7561{
7562 COMPREPLY=($( compgen -P "$prefix" -W "$( perl -e 'sub mods { my ($base,$dir)=@_; return if $base !~ /^\Q$ENV{cur}/; chdir($dir) or return; for (glob(q[*.pm])) {s/\.pm$//; print qq[$base$_\n]}; mods(/^(?:[.\d]+|$Config{archname}-$Config{osname}|auto)$/ ? undef : qq[${base}${_}\\\\:\\\\:],qq[$dir/$_]) for grep {-d} glob(q[*]); } mods(undef,$_) for @INC;' )" -- $cur ))
7563}
7564_pgids ()
7565{
7566 COMPREPLY=($( compgen -W '$( command ps axo pgid | sed 1d )' -- $cur ))
7567}
7568_pgrep ()
7569{
7570 local cur;
7571 COMPREPLY=();
7572 cur=`_get_cword`;
7573 _pnames;
7574 return 0
7575}
7576_pids ()
7577{
7578 COMPREPLY=($( compgen -W '$( command ps axo pid | sed 1d )' -- $cur ))
7579}
7580_pkg_config ()
7581{
7582 local cur;
7583 COMPREPLY=();
7584 cur=`_get_cword`;
7585 if [[ "$cur" == -* ]]; then
7586 COMPREPLY=($( compgen -W '-version --modversion \
7587 --atleast-pkgconfig-version= --libs --libs-only-l \
7588 --libs-only-other --libs-only-L --cflags \
7589 --cflags-only-I --cflags-only-other --variable= \
7590 --define-variable= --exists --uninstalled \
7591 --atleast-version= --exact-version= --max-version= \
7592 --list-all --debug --print-errors --silence-errors \
7593 --errors-to-stdout -? --help --usage' -- $cur));
7594 else
7595 COMPREPLY=($( pkg-config --list-all 2>/dev/null | awk '{print $1}' | grep "^$cur" ));
7596 fi
7597}
7598_pnames ()
7599{
7600 COMPREPLY=($( compgen -W '$( command ps axo command | \
7601 sed -e "1d; s/ .*//; s:.*/::; s/:$//;" \
7602 -e "s/^[[(-]//; s/[])]$//" \
7603 -e "s/^<defunct>$//")' -- $cur ))
7604}
7605_poff ()
7606{
7607 local prev cur conns;
7608 [ -r /etc/ppp/peers/ ] || return 0;
7609 COMPREPLY=();
7610 prev=${COMP_WORDS[COMP_CWORD-1]};
7611 cur=${COMP_WORDS[COMP_CWORD]};
7612 conns=$(\ls --color=none /etc/ppp/peers | egrep -v '(\.bak|~)$');
7613 if [[ "$cur" == -* ]]; then
7614 COMPREPLY=($(compgen -W '-r -d -c -a -h -v' -- $cur));
7615 return 0;
7616 fi;
7617 if [ $COMP_CWORD -eq 1 ] && [[ "$cur" != -* ]] || [[ "$prev" == -* ]]; then
7618 COMPREPLY=($(compgen -o filenames -W "$conns" $cur));
7619 fi;
7620 return 0
7621}
7622_pon ()
7623{
7624 local cur conns;
7625 [ -r /etc/ppp/peers/ ] || return 0;
7626 COMPREPLY=();
7627 cur=${COMP_WORDS[COMP_CWORD]};
7628 conns=$(\ls --color=none /etc/ppp/peers | egrep -v '(\.bak|~)$');
7629 if [ $COMP_CWORD -eq 1 ]; then
7630 COMPREPLY=($(compgen -o filenames -W "$conns" $cur));
7631 fi;
7632 return 0
7633}
7634_povray ()
7635{
7636 local cur prev povcur pfx oext defoext;
7637 defoext=png;
7638 COMPREPLY=();
7639 povcur=`_get_cword`;
7640 prev=${COMP_WORDS[COMP_CWORD-1]};
7641 _expand || return 0;
7642 case $povcur in
7643 [-+]I*)
7644 cur="${povcur#[-+]I}";
7645 pfx="${povcur%"$cur"}";
7646 _filedir pov;
7647 COMPREPLY=(${COMPREPLY[@]/#/$pfx});
7648 return 0
7649 ;;
7650 [-+]O*)
7651 case $( ( IFS='
7652'; echo "${COMP_WORDS[*]}" | grep '^[-+]F' ) ) in
7653 [-+]FN)
7654 oext=png
7655 ;;
7656 [-+]FP)
7657 oext=ppm
7658 ;;
7659 [-+]F[CT])
7660 oext=tga
7661 ;;
7662 *)
7663 oext=$defoext
7664 ;;
7665 esac;
7666 COMPREPLY=($( ( IFS='
7667'; echo "${COMP_WORDS[*]}" | grep '^[-+]I' ) ));
7668 COMPREPLY=(${COMPREPLY[@]#[-+]I});
7669 COMPREPLY=(${COMPREPLY[@]/%.pov/.$oext});
7670 cur="${povcur#[-+]O}";
7671 pfx="${povcur%"$cur"}";
7672 _filedir $oext;
7673 COMPREPLY=(${COMPREPLY[@]/#/$pfx});
7674 return 0
7675 ;;
7676 *.ini\[ | *.ini\[*[^]])
7677 cur="${povcur#*\[}";
7678 pfx="${povcur%\["$cur"}";
7679 [ -r "$pfx" ] || return 0;
7680 COMPREPLY=($(sed -e 's/^[[:space:]]*\[\('"$cur"'[^]]*\]\).*$/\1/' -e 't' -e 'd' -- "$pfx"));
7681 COMPREPLY=("${COMPREPLY[@]/#/$pfx[}");
7682 return 0
7683 ;;
7684 *)
7685 cur="$povcur";
7686 _filedir '?(ini|pov)';
7687 return 0
7688 ;;
7689 esac
7690}
7691_python ()
7692{
7693 local prev cur;
7694 COMPREPLY=();
7695 cur=`_get_cword`;
7696 prev=${COMP_WORDS[COMP_CWORD-1]##*/};
7697 case "$prev" in
7698 -Q)
7699 COMPREPLY=($( compgen -W "old new warn warnall" -- $cur ));
7700 return 0
7701 ;;
7702 -W)
7703 COMPREPLY=($( compgen -W "ignore default all module once error" -- $cur ));
7704 return 0
7705 ;;
7706 -c)
7707 _filedir '@(py|pyc|pyo)';
7708 return 0
7709 ;;
7710 !(python|-?))
7711 [[ ${COMP_WORDS[COMP_CWORD-2]} != -@(Q|W) ]] && _filedir
7712 ;;
7713 esac;
7714 for ((i=0; i < ${#COMP_WORDS[@]}-1; i++ ))
7715 do
7716 if [[ ${COMP_WORDS[i]} == -c ]]; then
7717 _filedir;
7718 fi;
7719 done;
7720 if [[ "$cur" != -* ]]; then
7721 _filedir '@(py|pyc|pyo)';
7722 else
7723 COMPREPLY=($( compgen -W "- -d -E -h -i -O -Q -S -t -u -U -v -V -W -x -c" -- $cur ));
7724 fi;
7725 return 0
7726}
7727_qrunner ()
7728{
7729 local cur;
7730 COMPREPLY=();
7731 cur=`_get_cword`;
7732 if [[ "$cur" == -* ]]; then
7733 COMPREPLY=($( compgen -W '-r --runner= --once -o \
7734 -l --list -v --verbose -s --subproc -h --help' -- $cur ));
7735 fi
7736}
7737_realcommand ()
7738{
7739 type -P "$1" > /dev/null && {
7740 if type -p realpath > /dev/null; then
7741 realpath "$(type -P "$1")";
7742 else
7743 if type -p readlink > /dev/null; then
7744 readlink -f "$(type -P "$1")";
7745 else
7746 type -P "$1";
7747 fi;
7748 fi
7749 }
7750}
7751_remove_members ()
7752{
7753 local cur prev;
7754 COMPREPLY=();
7755 cur=`_get_cword`;
7756 prev=${COMP_WORDS[COMP_CWORD-1]};
7757 case "$prev" in
7758 -@(f|-file=))
7759 _filedir;
7760 return 0
7761 ;;
7762 esac;
7763 if [[ "$cur" == -* ]]; then
7764 COMPREPLY=($( compgen -W '--file= -f --all -a \
7765 --fromall --nouserack -n --noadminack -N \
7766 --help -h' -- $cur ));
7767 else
7768 _mailman_lists;
7769 fi
7770}
7771_renice ()
7772{
7773 local command cur curopt i;
7774 COMPREPLY=();
7775 cur=`_get_cword`;
7776 command=$1;
7777 i=0;
7778 while [ $i -le $COMP_CWORD -a ${#COMPREPLY[@]} -eq 0 ]; do
7779 curopt=${COMP_WORDS[COMP_CWORD-$i]};
7780 case "$curopt" in
7781 -u)
7782 COMPREPLY=($( compgen -u -- $cur ))
7783 ;;
7784 -g)
7785 _pgids
7786 ;;
7787 -p | $command)
7788 _pids
7789 ;;
7790 esac;
7791 i=$(( ++i ));
7792 done
7793}
7794_ri ()
7795{
7796 local cur class method prefix ri_path ri_version separator IFS;
7797 local -a classes;
7798 COMPREPLY=();
7799 cur=`_get_cword`;
7800 ri_path=$(type -p ri);
7801 ri_version="$(ruby -W0 $ri_path -v 2>&1)" || ri_version=integrated;
7802 [ "$ri_version" != "${ri_version%200*}" ] && ri_version=integrated;
7803 IFS=',
7804 ';
7805 if [[ "$cur" == [A-Z]*[#.]* ]]; then
7806 [[ "$cur" == *#* ]] && separator=# || separator=.;
7807 class=${cur%$separator*};
7808 method=${cur#*$separator};
7809 classes=($class);
7810 prefix="-P $class$separator";
7811 ri_get_methods;
7812 return 0;
7813 fi;
7814 if [ "$ri_version" = integrated ]; then
7815 classes=($( ri -c | ruby -ne 'if /^\s*$/..$stdin.eof then \
7816 if /, [A-Z]+/ then print; end; end' ));
7817 else
7818 if [ "$ri_version" = "ri 1.8a" ]; then
7819 classes=($( ruby -W0 $ri_path | ruby -ne 'if /^'"'"'ri'"'"' has/..$stdin.eof then \
7820 if /^ .*[A-Z]/ then print; end; end' ));
7821 else
7822 classes=($( ruby -W0 $ri_path | ruby -ne 'if /^I have/..$stdin.eof then \
7823 if /^ .*[A-Z]/ then print; end; end' ));
7824 fi;
7825 fi;
7826 COMPREPLY=($( compgen -W '${classes[@]}' -- $cur ));
7827 if [[ "$cur" == [A-Z]* ]]; then
7828 return 0;
7829 fi;
7830 method=$cur;
7831 ri_get_methods
7832}
7833_rl_enabled ()
7834{
7835 [[ "$( bind -v )" = *$1+([[:space:]])on* ]]
7836}
7837_rmlist ()
7838{
7839 local cur;
7840 COMPREPLY=();
7841 cur=`_get_cword`;
7842 if [[ "$cur" == -* ]]; then
7843 COMPREPLY=($( compgen -W '--archives -a \
7844 -h --help' -- $cur ));
7845 else
7846 _mailman_lists;
7847 fi
7848}
7849_rmmod ()
7850{
7851 local cur;
7852 COMPREPLY=();
7853 cur=`_get_cword`;
7854 _installed_modules "$cur";
7855 return 0
7856}
7857_root_command ()
7858{
7859 PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin _command $1 $2 $3
7860}
7861_route ()
7862{
7863 local cur prev;
7864 COMPREPLY=();
7865 cur=`_get_cword`;
7866 prev=${COMP_WORDS[COMP_CWORD-1]};
7867 if [ "$prev" = dev ]; then
7868 COMPREPLY=($( ifconfig -a | sed -ne 's|^\('$cur'[^ ]*\).*$|\1|p' ));
7869 return 0;
7870 fi;
7871 COMPREPLY=($( compgen -W 'add del -host -net netmask metric mss \
7872 window irtt reject mod dyn reinstate dev \
7873 default gw' -- $cur ));
7874 COMPREPLY=($( echo " ${COMP_WORDS[@]}" | (while read -d ' ' i; do
7875 [ "$i" == "" ] && continue
7876 # flatten array with spaces on either side,
7877 # otherwise we cannot grep on word
7878 # boundaries of first and last word
7879 COMPREPLY=" ${COMPREPLY[@]} "
7880 # remove word from list of completions
7881 COMPREPLY=( ${COMPREPLY/ $i / } )
7882 done
7883 echo "${COMPREPLY[@]}")
7884 ));
7885 return 0
7886}
7887_rpm ()
7888{
7889 local cur prev nodig nosig;
7890 COMPREPLY=();
7891 cur=`_get_cword`;
7892 prev=${COMP_WORDS[COMP_CWORD-1]};
7893 nodig="";
7894 nosig="";
7895 _rpm_nodigsig;
7896 if [ $COMP_CWORD -eq 1 ]; then
7897 case "$cur" in
7898 -b*)
7899 COMPREPLY=($( compgen -W '-ba -bb -bc -bi -bl -bp -bs' -- $cur ))
7900 ;;
7901 -t*)
7902 COMPREPLY=($( compgen -W '-ta -tb -tc -ti -tl -tp -ts' -- $cur ))
7903 ;;
7904 --*)
7905 COMPREPLY=($( compgen -W '--help --version --initdb \
7906 --checksig --recompile --rebuild --resign --addsign \
7907 --rebuilddb --showrc --setperms --setugids --tarbuild \
7908 --eval --install --upgrade --query --freshen --erase \
7909 --verify --querytags --rmsource --rmspec --clean \
7910 --import' -- $cur ))
7911 ;;
7912 *)
7913 COMPREPLY=($( compgen -W '-b -e -E -F -i -q -t -U -V' -- $cur ))
7914 ;;
7915 esac;
7916 return 0;
7917 fi;
7918 case "$prev" in
7919 --@(@(db|exclude)path|prefix|relocate|root))
7920 _filedir -d;
7921 return 0
7922 ;;
7923 --eval | -E)
7924 COMPREPLY=($( rpm --showrc | sed -ne 's/^-\?[0-9]\+[:=][[:space:]]\+\('${cur#%}'[^[:space:](]*\).*/\1/p' ));
7925 COMPREPLY=("${COMPREPLY[@]/#/%}");
7926 return 0
7927 ;;
7928 --pipe)
7929 COMPREPLY=($( compgen -c -- $cur ));
7930 return 0
7931 ;;
7932 --rcfile)
7933 _filedir;
7934 return 0
7935 ;;
7936 --specfile)
7937 _filedir spec;
7938 return 0
7939 ;;
7940 --whatprovides)
7941 if [[ "$cur" == */* ]]; then
7942 _filedir;
7943 else
7944 COMPREPLY=($( rpm -qa $nodig $nosig --queryformat '%{providename}\n' | grep "^$cur" ));
7945 fi;
7946 return 0
7947 ;;
7948 --whatrequires)
7949 COMPREPLY=($( rpm -qa $nodig $nosig --queryformat '%{requirename}\n' | grep "^$cur" ));
7950 return 0
7951 ;;
7952 --target)
7953 COMPREPLY=($( compgen -W "$( command rpm --showrc | sed -ne 's/^\s*compatible\s\+build\s\+archs\s*:\s*\(.*\)/\1/ p' )" -- $cur ));
7954 return 0
7955 ;;
7956 esac;
7957 case "${COMP_WORDS[1]}" in
7958 -@([iFU]*|-install|-freshen|-upgrade))
7959 if [[ "$cur" == -* ]]; then
7960 COMPREPLY=($( compgen -W '--percent --force --test \
7961 --replacepkgs --replacefiles --root --excludedocs \
7962 --includedocs --noscripts --rcfile --ignorearch \
7963 --dbpath --prefix --ignoreos --nodeps --allfiles \
7964 --ftpproxy --ftpport --justdb --httpproxy --httpport \
7965 --noorder --relocate --badreloc --notriggers \
7966 --excludepath --ignoresize --oldpackage --define \
7967 --eval --pipe --queryformat --repackage --nosuggests \
7968 --nodigest --nosignature' -- $cur ));
7969 else
7970 _filedir 'rpm';
7971 fi
7972 ;;
7973 -@(e|-erase))
7974 if [[ "$cur" == -* ]]; then
7975 COMPREPLY=($( compgen -W '--allmatches --noscripts \
7976 --notriggers --nodeps --test --repackage' -- $cur ));
7977 else
7978 _rpm_installed_packages "$nodig" "$nosig";
7979 fi
7980 ;;
7981 -@(q*|-query))
7982 if [ "${COMP_LINE#* -*([^ -])f}" != "$COMP_LINE" ]; then
7983 if [[ "$cur" == -* ]]; then
7984 COMPREPLY=($( compgen -W '--scripts --root \
7985 --rcfile --requires --ftpport --ftpproxy \
7986 --httpproxy --httpport --provides --triggers \
7987 --dump --changelog --dbpath \
7988 --last --filesbypkg \
7989 --info --list --state \
7990 --docfiles --configfiles --queryformat \
7991 --conflicts --obsoletes \
7992 --nodigest --nosignature \
7993 --suggests --enhances \
7994 --triggerscripts' -- $cur ));
7995 else
7996 _filedir;
7997 fi;
7998 else
7999 if [ "${COMP_LINE#* -*([^ -])g}" != "$COMP_LINE" ]; then
8000 _rpm_groups;
8001 else
8002 if [ "${COMP_LINE#* -*([^ -])p}" != "$COMP_LINE" ]; then
8003 if [[ "$cur" == -* ]]; then
8004 COMPREPLY=($( compgen -W '--scripts --root \
8005 --rcfile --whatprovides --whatrequires \
8006 --requires --triggeredby --ftpport --ftpproxy \
8007 --httpproxy --httpport --provides --triggers \
8008 --dump --changelog --dbpath --filesbypkg \
8009 --define --eval --pipe --showrc --info --list \
8010 --state --docfiles --configfiles --queryformat\
8011 --conflicts --obsoletes --nodigest \
8012 --nosignature' -- $cur ));
8013 else
8014 _filedir 'rpm';
8015 fi;
8016 else
8017 if [[ "$cur" == -* ]]; then
8018 COMPREPLY=($( compgen -W '--scripts --root \
8019 --rcfile --whatprovides --whatrequires \
8020 --requires --triggeredby --ftpport --ftpproxy \
8021 --httpproxy --httpport --provides --triggers \
8022 --dump --changelog --dbpath --specfile \
8023 --querybynumber --last --filesbypkg --define \
8024 --eval --pipe --showrc --info --list --state \
8025 --docfiles --configfiles --queryformat \
8026 --conflicts --obsoletes --pkgid --hdrid \
8027 --fileid --tid --nodigest --nosignature \
8028 --triggerscripts' -- $cur ));
8029 else
8030 if [ "${COMP_LINE#* -*([^ -])a}" == "$COMP_LINE" ]; then
8031 _rpm_installed_packages "$nodig" "$nosig";
8032 fi;
8033 fi;
8034 fi;
8035 fi;
8036 fi
8037 ;;
8038 -@(K*|-checksig))
8039 if [[ "$cur" == -* ]]; then
8040 COMPREPLY=($( compgen -W '--nopgp --nogpg --nomd5 \
8041 --nodigest --nosignature' -- $cur ));
8042 else
8043 _filedir 'rpm';
8044 fi
8045 ;;
8046 -@([Vy]*|-verify))
8047 if [[ "$cur" == -* ]]; then
8048 COMPREPLY=($( compgen -W '--root --rcfile --dbpath \
8049 --nodeps --nogroup --nolinkto --nomode --nomtime \
8050 --nordev --nouser --nofiles --noscripts --nomd5 \
8051 --querytags --specfile --whatrequires --whatprovides \
8052 --nodigest --nosignature' -- $cur ));
8053 else
8054 if [ "${COMP_LINE#* -*([^ -])f}" != "$COMP_LINE" ]; then
8055 _filedir;
8056 else
8057 if [ "${COMP_LINE#* -*([^ -])g}" != "$COMP_LINE" ]; then
8058 _rpm_groups;
8059 else
8060 if [ "${COMP_LINE#* -*([^ -])p}" != "$COMP_LINE" ]; then
8061 _filedir 'rpm';
8062 else
8063 _rpm_installed_packages "$nodig" "$nosig";
8064 fi;
8065 fi;
8066 fi;
8067 fi
8068 ;;
8069 -[bt]*)
8070 if [[ "$cur" == -* ]]; then
8071 COMPREPLY=($( compgen -W '--short-circuit --timecheck \
8072 --clean --rmsource --rmspec --test --sign --buildroot \
8073 --target --nobuild --nodeps --nodirtokens' -- $cur ));
8074 else
8075 if [[ ${COMP_WORDS[1]} == -b* ]]; then
8076 _filedir 'spec';
8077 else
8078 _filedir '@(tgz|tar.@(gz|bz2|lzma))';
8079 fi;
8080 fi
8081 ;;
8082 --re@(build|compile))
8083 if [[ "$cur" == -* ]]; then
8084 COMPREPLY=($( compgen -W '--nodeps --rmsource \
8085 --rmspec --sign --nodirtokens --target' -- $cur ));
8086 else
8087 _filedir '?(no)src.rpm';
8088 fi
8089 ;;
8090 --tarbuild)
8091 _filedir '@(tgz|tar.@(gz|bz2|lzma))'
8092 ;;
8093 --@(re|add)sign)
8094 _filedir 'rpm'
8095 ;;
8096 --set@(perms|gids))
8097 _rpm_installed_packages "$nodig" "$nosig"
8098 ;;
8099 --@(clean|rms@(ource|pec)))
8100 if [[ "$cur" == -* ]]; then
8101 COMPREPLY=($( compgen -W '--clean --rmsource \
8102 --rmspec' -- $cur ));
8103 else
8104 _filedir 'spec';
8105 fi
8106 ;;
8107 --@(import|dbpath|root))
8108 if [[ "$cur" == -* ]]; then
8109 COMPREPLY=($( compgen -W '--import --dbpath --root' -- $cur ));
8110 else
8111 _filedir;
8112 fi
8113 ;;
8114 esac;
8115 return 0
8116}
8117_rpm_groups ()
8118{
8119 local IFS=' ';
8120 cur=${cur%"\\"};
8121 COMPREPLY=($( rpm -qa $nodig $nosig --queryformat '%{group}\n' | grep "^$cur" ));
8122 COMPREPLY=($( echo "${COMPREPLY[@]}" | sed 's/ /\\ /g' | tr '\n' '\t' ))
8123}
8124_rpm_installed_packages ()
8125{
8126 local ver nodig="$1" nosig="$2";
8127 if [ -r /var/log/rpmpkgs -a /var/log/rpmpkgs -nt /var/lib/rpm/Packages ]; then
8128 COMPREPLY=($( sed -ne 's|^\('$cur'[^[:space:]]*\)-[^[:space:]-]\+-[^[:space:]-]\+\.rpm$|\1|p' /var/log/rpmpkgs ));
8129 else
8130 _rpm_nodigsig;
8131 COMPREPLY=($( rpm -qa $nodig $nosig --qf='%{NAME} ' "$cur*" ));
8132 fi
8133}
8134_rpm_nodigsig ()
8135{
8136 if [ -z "$nodig" -a -z "$nosig" ]; then
8137 local rpmver;
8138 rpmver=$(rpm --version);
8139 rpmver=${rpmver##* };
8140 if [[ "$rpmver" > "4.0.4" ]]; then
8141 nodig="--nodigest";
8142 fi;
8143 if [[ "$rpmver" > "4.0.99" ]]; then
8144 nosig="--nosignature";
8145 fi;
8146 fi
8147}
8148_rsync ()
8149{
8150 local cur prev shell i userhost path;
8151 COMPREPLY=();
8152 cur=`_get_cword`;
8153 prev=${COMP_WORDS[COMP_CWORD-1]};
8154 _expand || return 0;
8155 case "$prev" in
8156 --@(config|password-file|include-from|exclude-from))
8157 _filedir;
8158 return 0
8159 ;;
8160 -@(T|-temp-dir|-compare-dest))
8161 _filedir -d;
8162 return 0
8163 ;;
8164 -@(e|-rsh))
8165 COMPREPLY=($( compgen -W 'rsh ssh' -- $cur ));
8166 return 0
8167 ;;
8168 esac;
8169 case "$cur" in
8170 -*)
8171 COMPREPLY=($( compgen -W '-v -q -c -a -r -R -b -u -l -L -H \
8172 -p -o -g -D -t -S -n -W -x -B -e -C -I -T -P \
8173 -z -h -4 -6 --verbose --quiet --checksum \
8174 --archive --recursive --relative --backup \
8175 --backup-dir --suffix= --update --links \
8176 --copy-links --copy-unsafe-links --safe-links \
8177 --hard-links --perms --owner --group --devices\
8178 --times --sparse --dry-run --whole-file \
8179 --no-whole-file --one-file-system \
8180 --block-size= --rsh= --rsync-path= \
8181 --cvs-exclude --existing --ignore-existing \
8182 --delete --delete-excluded --delete-after \
8183 --ignore-errors --max-delete= --partial \
8184 --force --numeric-ids --timeout= \
8185 --ignore-times --size-only --modify-window= \
8186 --temp-dir= --compare-dest= --compress \
8187 --exclude= --exclude-from= --include= \
8188 --include-from= --version --daemon --no-detach\
8189 --address= --config= --port= --blocking-io \
8190 --no-blocking-io --stats --progress \
8191 --log-format= --password-file= --bwlimit= \
8192 --write-batch= --read-batch= --help' -- $cur ))
8193 ;;
8194 *:*)
8195 shell=ssh;
8196 for ((i=1; i < COMP_CWORD; i++ ))
8197 do
8198 if [[ "${COMP_WORDS[i]}" == -@(e|-rsh) ]]; then
8199 shell=${COMP_WORDS[i+1]};
8200 break;
8201 fi;
8202 done;
8203 if [[ "$shell" == ssh ]]; then
8204 cur=${cur/\\:/:};
8205 userhost=${cur%%?(\\):*};
8206 path=${cur#*:};
8207 path=${path//\\\\\\\\ / };
8208 if [ -z "$path" ]; then
8209 path=$(ssh -o 'Batchmode yes' $userhost pwd 2>/dev/null);
8210 fi;
8211 COMPREPLY=($( ssh -o 'Batchmode yes' $userhost command ls -aF1d "$path*" 2>/dev/null | sed -e 's/ /\\\\\\\ /g' -e 's/[*@|=]$//g' -e 's/[^\/]$/& /g' ));
8212 fi
8213 ;;
8214 *)
8215 _known_hosts -c -a;
8216 _filedir
8217 ;;
8218 esac;
8219 return 0
8220}
8221_sbcl ()
8222{
8223 local cur;
8224 COMPREPLY=();
8225 cur=`_get_cword`;
8226 if [[ "$cur" == -* ]]; then
8227 COMPREPLY=($( compgen -W '--core --noinform --help --version \
8228 --sysinit --userinit --eval --noprint --disable-debugger \
8229 --end-runtime-options --end-toplevel-options ' -- $cur ));
8230 else
8231 _filedir;
8232 fi;
8233 return 0
8234}
8235_scp ()
8236{
8237 local cur userhost path;
8238 local optconfigfile;
8239 COMPREPLY=();
8240 cur=`_get_cword ":"`;
8241 _expand || return 0;
8242 if [[ "$cur" == *:* ]]; then
8243 local IFS='
8244';
8245 cur=${cur/\\:/:};
8246 userhost=${cur%%?(\\):*};
8247 path=${cur#*:};
8248 path=${path//\\\\\\\\ / };
8249 if [ -z "$path" ]; then
8250 path=$(ssh -o 'Batchmode yes' $userhost pwd 2>/dev/null);
8251 fi;
8252 COMPREPLY=($( ssh -o 'Batchmode yes' $userhost command ls -aF1d "$path*" 2>/dev/null | sed -e "s/[][(){}<>\",:;^&\!$=?\`|\\ ']/\\\\\\\\\\\\&/g" -e 's/[*@|=]$//g' -e 's/[^\/]$/& /g' ));
8253 return 0;
8254 fi;
8255 set -- "${COMP_WORDS[@]}";
8256 while [ $# -gt 0 ]; do
8257 if [ "${1:0:2}" = -F ]; then
8258 if [ ${#1} -gt 2 ]; then
8259 optconfigfile="$(dequote "$1")";
8260 else
8261 shift;
8262 [ "$1" ] && optconfigfile="$(dequote "-F$1")";
8263 fi;
8264 break;
8265 fi;
8266 shift;
8267 done;
8268 [[ "$cur" == */* ]] || _known_hosts -c -a "$optconfigfile";
8269 local IFS='
8270';
8271 COMPREPLY=("${COMPREPLY[@]}" $( command ls -aF1d $cur* 2>/dev/null | sed -e "s/[][(){}<>\",:;^&\!$=?\`|\\ ']/\\\\&/g" -e 's/[*@|=]$//g' -e 's/[^\/]$/& /g' ));
8272 return 0
8273}
8274_screen ()
8275{
8276 local cur prev preprev;
8277 COMPREPLY=();
8278 cur=`_get_cword`;
8279 prev=${COMP_WORDS[COMP_CWORD-1]};
8280 [ "$COMP_CWORD" -ge 2 ] && preprev=${COMP_WORDS[COMP_CWORD-2]};
8281 if [ "$preprev" = "-d" -o "$preprev" = "-D" -a "$prev" = "-r" -o "$prev" = "-R" ]; then
8282 COMPREPLY=($( command screen -ls | sed -ne 's|^['' '']\+\('$cur'[0-9]\+\.[^'' '']\+\).*$|\1|p' ));
8283 else
8284 case "$prev" in
8285 -[rR])
8286 COMPREPLY=($( command screen -ls | sed -ne 's|^['' '']\+\('$cur'[0-9]\+\.[^'' '']\+\).*Detached.*$|\1|p' ))
8287 ;;
8288 -[dDx])
8289 COMPREPLY=($( command screen -ls | sed -ne 's|^['' '']\+\('$cur'[0-9]\+\.[^'' '']\+\).*Attached.*$|\1|p' ))
8290 ;;
8291 -s)
8292 COMPREPLY=($( grep ^${cur:-[^#]} /etc/shells ))
8293 ;;
8294 *)
8295
8296 ;;
8297 esac;
8298 fi;
8299 return 0
8300}
8301_service ()
8302{
8303 local cur sysvdir;
8304 COMPREPLY=();
8305 prev=${COMP_WORDS[COMP_CWORD-1]};
8306 cur=`_get_cword`;
8307 [[ ${COMP_WORDS[0]} != @(*init.d/!(functions|~)|service) ]] && return 0;
8308 [ $COMP_CWORD -gt 2 ] && return 0;
8309 [ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d || sysvdir=/etc/init.d;
8310 if [[ $COMP_CWORD -eq 1 ]] && [[ $prev == "service" ]]; then
8311 _services;
8312 else
8313 COMPREPLY=($( compgen -W '`sed -ne "y/|/ /; \
8314 s/^.*Usage.*{\(.*\)}.*$/\1/p" \
8315 $sysvdir/${prev##*/} 2>/dev/null`' -- $cur ));
8316 fi;
8317 return 0
8318}
8319_services ()
8320{
8321 local sysvdir famdir;
8322 [ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d || sysvdir=/etc/init.d;
8323 famdir=/etc/xinetd.d;
8324 COMPREPLY=($( builtin echo $sysvdir/!(*.rpm@(orig|new|save)|*~|functions)));
8325 if [ -d $famdir ]; then
8326 COMPREPLY=("${COMPREPLY[@]}" $( builtin echo $famdir/!(*.rpm@(orig|new|save)|*~)));
8327 fi;
8328 COMPREPLY=($( compgen -W '${COMPREPLY[@]#@($sysvdir|$famdir)/}' -- $cur ))
8329}
8330_signals ()
8331{
8332 local i;
8333 COMPREPLY=($( compgen -A signal SIG${cur#-} ));
8334 for ((i=0; i < ${#COMPREPLY[@]}; i++ ))
8335 do
8336 COMPREPLY[i]=-${COMPREPLY[i]#SIG};
8337 done
8338}
8339_sitecopy ()
8340{
8341 local cur;
8342 COMPREPLY=();
8343 cur=`_get_cword`;
8344 case "$cur" in
8345 --*)
8346 COMPREPLY=($( compgen -W "$(sitecopy -h | grep -e '--\w' | awk '{sub (/=(FILE|PATH)/, "", $2); print $2}')" -- $cur ))
8347 ;;
8348 -*)
8349 COMPREPLY=($( compgen -W "$(sitecopy -h | grep -e '-\w' | awk '{sub (",", "", $1); print $1}')" -- $cur ))
8350 ;;
8351 *)
8352 if [ -r ~/.sitecopyrc ]; then
8353 COMPREPLY=($( compgen -W "$(grep '^["$'\t '"]*site' ~/.sitecopyrc | awk '{print $2}')" -- $cur ));
8354 fi
8355 ;;
8356 esac;
8357 return 0
8358}
8359_snarf ()
8360{
8361 local cur;
8362 COMPREPLY=();
8363 cur=`_get_cword`;
8364 prev=${COMP_WORDS[COMP_CWORD-1]};
8365 case "$prev" in
8366 -i)
8367 _interfaces;
8368 return 0
8369 ;;
8370 esac;
8371 if [[ "$cur" == -* ]]; then
8372 COMPREPLY=($( compgen -W '-i -v' -- $cur ));
8373 fi
8374}
8375_snownews ()
8376{
8377 local cur;
8378 COMPREPLY=();
8379 cur=`_get_cword`;
8380 if [[ "$cur" == -* ]]; then
8381 COMPREPLY=($( compgen -W '--update --help --version \
8382 --disable-versioncheck -u -h -V' -- $cur));
8383 fi
8384}
8385_ssh ()
8386{
8387 local cur prev;
8388 local optconfigfile;
8389 local -a config;
8390 COMPREPLY=();
8391 cur=`_get_cword`;
8392 prev=${COMP_WORDS[COMP_CWORD-1]};
8393 case "$prev" in
8394 -F)
8395 _filedir
8396 ;;
8397 -*c)
8398 COMPREPLY=($( compgen -W 'blowfish 3des 3des-cbc blowfish-cbc \
8399 arcfour cast128-cbc' -- $cur ))
8400 ;;
8401 -*i)
8402 _filedir
8403 ;;
8404 -*l)
8405 COMPREPLY=($( compgen -u -- $cur ))
8406 ;;
8407 *)
8408 set -- "${COMP_WORDS[@]}";
8409 while [ $# -gt 0 ]; do
8410 if [ "${1:0:2}" = -F ]; then
8411 if [ ${#1} -gt 2 ]; then
8412 optconfigfile="$(dequote "$1")";
8413 else
8414 shift;
8415 [ "$1" ] && optconfigfile="$(dequote "-F$1")";
8416 fi;
8417 break;
8418 fi;
8419 shift;
8420 done;
8421 _known_hosts -a "$optconfigfile";
8422 [ $COMP_CWORD -eq 1 -o -n "$optconfigfile" ] || COMPREPLY=("${COMPREPLY[@]}" $( compgen -c -- $cur ))
8423 ;;
8424 esac;
8425 return 0
8426}
8427_ssh_copy_id ()
8428{
8429 local cur prev;
8430 COMPREPLY=();
8431 cur=`_get_cword`;
8432 prev=${COMP_WORDS[COMP_CWORD-1]};
8433 case "$prev" in
8434 -*i)
8435 _filedir
8436 ;;
8437 *)
8438 _known_hosts -a;
8439 [ $COMP_CWORD -eq 1 ] || COMPREPLY=("${COMPREPLY[@]}" $( compgen -- $cur ))
8440 ;;
8441 esac;
8442 return 0
8443}
8444_sshmitm ()
8445{
8446 local cur;
8447 COMPREPLY=();
8448 cur=`_get_cword`;
8449 if [[ "$cur" == -* ]]; then
8450 COMPREPLY=($( compgen -W '-d -I -p' -- $cur ));
8451 else
8452 _known_hosts;
8453 fi
8454}
8455_sshow ()
8456{
8457 local cur;
8458 COMPREPLY=();
8459 cur=`_get_cword`;
8460 prev=${COMP_WORDS[COMP_CWORD-1]};
8461 case "$prev" in
8462 -i)
8463 _interfaces;
8464 return 0
8465 ;;
8466 esac;
8467 if [[ "$cur" == -* ]]; then
8468 COMPREPLY=($( compgen -W '-d -i' -- $cur ));
8469 fi
8470}
8471_svk ()
8472{
8473 local cur prev commands options command;
8474 COMPREPLY=();
8475 cur=`_get_cword`;
8476 commands='add admin annotate ann blame praise cat checkout co cleanup \
8477 cmerge cm commit ci copy cp delete del remove rm depotmap \
8478 depot describe desc diff di help h ? import info list ls log \
8479 merge mirror mi mkdir move mv ren rename patch propdel pd pdel \
8480 propedit pe pedit propget pg pget proplist pl plist propset ps \
8481 pset pull push resolved revert smerge sm status st stat switch \
8482 sw sync sy update up verify';
8483 if [[ $COMP_CWORD -eq 1 ]]; then
8484 if [[ "$cur" == -* ]]; then
8485 COMPREPLY=($( compgen -W '--version' -- $cur ));
8486 else
8487 COMPREPLY=($( compgen -W "$commands" -- $cur ));
8488 fi;
8489 else
8490 prev=${COMP_WORDS[COMP_CWORD-1]};
8491 case $prev in
8492 -@(F|-file|-targets))
8493 _filedir;
8494 return 0
8495 ;;
8496 --encoding)
8497 COMPREPLY=($( compgen -W '$( iconv --list | sed -e "s@//@@;" )' -- "$cur" ));
8498 return 0
8499 ;;
8500 esac;
8501 command=${COMP_WORDS[1]};
8502 if [[ "$cur" == -* ]]; then
8503 case $command in
8504 add)
8505 options=' --non-recursive -N -q --quiet'
8506 ;;
8507 @(blame|annotate|ann|praise))
8508 options='-r --revisions -x --cross'
8509 ;;
8510 cat)
8511 options='-r --revision'
8512 ;;
8513 @(checkout|co))
8514 options='-r --revision -q --quiet -N \
8515 --non-recursive -l --list -d \
8516 --detach --export --relocate \
8517 --purge'
8518 ;;
8519 cleanup)
8520 options='-a --all'
8521 ;;
8522 @(cmerge|cm))
8523 options='-c --change -l --log -r \
8524 --revision -a --auto \
8525 --verbatim --no-ticket -m \
8526 --message -F --file --template \ --encoding -P --patch -S \
8527 --sign -C --check-only --direct'
8528 ;;
8529 @(commit|ci))
8530 options='--import -m --message -F \
8531 --file --encoding --template \
8532 -P --patch -S --sign -C \
8533 --check-only -N \
8534 --non-recursive --direct'
8535 ;;
8536 @(copy|cp))
8537 options='-r --revision -p --parent -q \
8538 --quiet -m --message -F --file \
8539 --template --encoding -P \
8540 --patch -S --sign -C \
8541 --check-only --direct'
8542 ;;
8543 @(delete|del|remove|rm))
8544 options='-k --keep-local -m --message \
8545 -F --file --encoding \
8546 --template -P --patch -S \
8547 --sign -C --check-only --direct'
8548 ;;
8549 @(depotmap|depot))
8550 options='-i --init -l --list -d \
8551 --detach --relocate'
8552 ;;
8553 @(diff|di))
8554 options='-r --revision -s --summarize \
8555 -b --verbose -N --non-recursive'
8556 ;;
8557 import)
8558 options='-f --from-checkout -t \
8559 --to-checkout -m --message -F \
8560 --file --template --encoding \
8561 -P --patch -S --sign -C \
8562 --check-only -N \
8563 --non-recursive --direct'
8564 ;;
8565 @(list|ls))
8566 options='-r --revision -v --verbose -R \
8567 --recursive -d --depth -f \
8568 --full-path'
8569 ;;
8570 log)
8571 options='-r --revision -l --limit -q \
8572 --quiet -x --cross -v --verbose'
8573 ;;
8574 merge)
8575 options='-r --revision -c --change -I \
8576 --incremental -a --auto -l \
8577 --log -s --sync -t --to -f \
8578 --from --verbatim --no-ticket \
8579 --track-rename -m --message \
8580 -F --file --template \
8581 --encoding -P --patch -S \
8582 --sign -C --check-only --direct'
8583 ;;
8584 @(mirror|mi))
8585 options='-l --list -d --detach \
8586 --relocate --recover --unlock \
8587 --upgrade'
8588 ;;
8589 mkdir)
8590 options='-p --parent -m --message -F \
8591 --file --template --encoding \
8592 -P --patch -S --sign -C \
8593 --check-only --direct'
8594 ;;
8595 @(move|mv|rename|ren))
8596 options='-r --revision -p --parent -q \
8597 --quiet -m --message -F --file \
8598 --encoding --template -P \
8599 --patch -S --sign -C \
8600 --check-only --direct'
8601 ;;
8602 patch)
8603 options='--depot'
8604 ;;
8605 @(propdel|propset|pdel|pset|pd|ps))
8606 options='-R --recursive -r --revision \
8607 --revprop -m --message -F \
8608 --file --template --encoding \
8609 -P --patch -S --sign -C \
8610 --check-only -q --quiet \
8611 --direct'
8612 ;;
8613 @(propedit|pedit|pe))
8614 options='-R --recursive -r --revision \
8615 --revprop -m --message -F \
8616 --file --template --encoding \
8617 -P --patch -S --sign -C \
8618 --check-only --direct'
8619 ;;
8620 @(propget|pget|pg))
8621 options='-R --recursive -r --revision \
8622 --revprop --strict'
8623 ;;
8624 @(proplist|plist|pl))
8625 options='-R --recursive -v --verbose \
8626 -r --revision --revprop'
8627 ;;
8628 pull)
8629 options='-a --all -l --lump'
8630 ;;
8631 push)
8632 options='-f --from -l --lump -C \
8633 --check -P --patch -S --sign \
8634 --verbatim'
8635 ;;
8636 resolved)
8637 options='-R --recursive'
8638 ;;
8639 revert)
8640 options='-R --recursive -q --quiet'
8641 ;;
8642 @(smerge|sm))
8643 options='-I --incremental -l --log -B \
8644 --baseless -b --base -s --sync \
8645 -t --to -f --from --verbatim \
8646 --no-ticket --track-rename \
8647 --host --remoterev -m \
8648 --message -F --file --template \
8649 --encoding -P --patch -S \
8650 --sign -C --check-only --direct'
8651 ;;
8652 @(status|stat|st))
8653 options='-q --quiet --no-ignore -N \
8654 --non-recursive -v --verbose'
8655 ;;
8656 @(switch|sw))
8657 options='-r --revision -d --detach -q \
8658 --quiet'
8659 ;;
8660 @(sync|sy))
8661 options='-a --all -s --skipto -t \
8662 --torev'
8663 ;;
8664 @(update|up))
8665 options='-r --revision -N \
8666 --non-recursive -C \
8667 --check-only -s --sync -m \
8668 --merge -q --quiet'
8669 ;;
8670 esac;
8671 options="$options --help -h";
8672 COMPREPLY=($( compgen -W "$options" -- $cur ));
8673 else
8674 case $command in
8675 @(help|h|\?))
8676 COMPREPLY=($( compgen -W "$commands environment commands intro" -- $cur ))
8677 ;;
8678 admin)
8679 COMPREPLY=($( compgen -W 'help \
8680 deltify dump hotcopy \
8681 list-dblogs list-unused-dblogs \
8682 load lstxns recover rmtxns \
8683 setlog verify rmcache' -- $cur ))
8684 ;;
8685 patch)
8686 COMPREPLY=($( compgen -W '--ls --list \
8687 --cat --view --regen \
8688 --regenerate --up --update \
8689 --apply --rm --delete' -- $cur ))
8690 ;;
8691 sync)
8692 COMPREPLY=($( compgen -W "$( svk mirror --list 2>/dev/null | awk '/^\//{print $1}' )" -- $cur ))
8693 ;;
8694 @(co|checkout|push|pull))
8695 if [[ "$cur" == //*/* ]]; then
8696 path=${cur%/*}/;
8697 else
8698 path=//;
8699 fi;
8700 COMPREPLY=($( compgen -W "$( svk list $path 2>/dev/null | sed -e 's|\(.*\)|'$path'\1|')" -- $cur ))
8701 ;;
8702 *)
8703 _filedir
8704 ;;
8705 esac;
8706 fi;
8707 fi;
8708 return 0
8709}
8710_sync_members ()
8711{
8712 local cur prev;
8713 COMPREPLY=();
8714 cur=`_get_cword`;
8715 prev=${COMP_WORDS[COMP_CWORD-1]};
8716 case "$prev" in
8717 -@(w|g|d|--welcome-msg=|-goodbye-msg|-digest=))
8718 COMPREPLY=($( compgen -W 'y n' -- $cur));
8719 return 0
8720 ;;
8721 -@(d|-file))
8722 _filedir;
8723 return 0
8724 ;;
8725 esac;
8726 if [[ "$cur" == -* ]]; then
8727 COMPREPLY=($( compgen -W '--no-change -n --welcome-msg= -w \
8728 --goodbye-msg= -g --digest= -d --notifyadmin= -a \
8729 -f --file -h --help' -- $cur ));
8730 else
8731 _mailman_lists;
8732 fi
8733}
8734_sysctl ()
8735{
8736 local cur;
8737 COMPREPLY=();
8738 cur=`_get_cword`;
8739 COMPREPLY=($( compgen -W "$(sysctl -N -a 2>/dev/null)" -- $cur ));
8740 return 0
8741}
8742_tar ()
8743{
8744 local cur ext regex tar untar;
8745 COMPREPLY=();
8746 cur=`_get_cword`;
8747 if [ $COMP_CWORD -eq 1 ]; then
8748 COMPREPLY=($( compgen -W 'c t x u r d A' -- $cur ));
8749 return 0;
8750 fi;
8751 case "${COMP_WORDS[1]}" in
8752 ?(-)[cr]*f)
8753 _filedir;
8754 return 0
8755 ;;
8756 +([^IZzJjy])f)
8757 ext='t@(ar?(.@(Z|gz|bz?(2)|lz?(ma)))|gz|bz?(2)|lz?(ma))';
8758 regex='t\(ar\(\.\(Z\|gz\|bz2\?\|lzma\)\)\?\|gz\|bz2\?\|lzma\)'
8759 ;;
8760 *[Zz]*f)
8761 ext='t?(ar.)@(gz|Z)';
8762 regex='t\(ar\.\)\?\(gz\|Z\)'
8763 ;;
8764 *[Ijy]*f)
8765 ext='t?(ar.)bz?(2)';
8766 regex='t\(ar\.\)\?bz2\?'
8767 ;;
8768 *[J]*f)
8769 ext='t?(ar.)lz?(ma)';
8770 regex='t\(ar\.\)\?lzma\?'
8771 ;;
8772 *)
8773 _filedir;
8774 return 0
8775 ;;
8776 esac;
8777 if [[ "$COMP_LINE" == *$ext' ' ]]; then
8778 tar=$( echo "$COMP_LINE" | sed -e 's/^.* \([^ ]*'$regex'\) .*$/\1/' );
8779 untar=t${COMP_WORDS[1]//[^Izjyf]/};
8780 COMPREPLY=($( compgen -W "$( echo $( tar $untar $tar 2>/dev/null ) )" -- "$cur" ));
8781 return 0;
8782 fi;
8783 _filedir "$ext";
8784 return 0
8785}
8786_tcpdump ()
8787{
8788 local cur;
8789 COMPREPLY=();
8790 cur=`_get_cword`;
8791 prev=${COMP_WORDS[COMP_CWORD-1]};
8792 case "$prev" in
8793 -@(r|w|F))
8794 _filedir;
8795 return 0
8796 ;;
8797 -i)
8798 _available_interfaces -a;
8799 return 0
8800 ;;
8801 esac;
8802 if [[ "$cur" == -* ]]; then
8803 COMPREPLY=($( compgen -W '-a -d -e -f -l -n -N -O -p \
8804 -q -R -S -t -u -v -x -C -F -i -m -r -s -T -w \
8805 -E' -- $cur ));
8806 fi
8807}
8808_tcpkill ()
8809{
8810 local cur;
8811 COMPREPLY=();
8812 cur=`_get_cword`;
8813 prev=${COMP_WORDS[COMP_CWORD-1]};
8814 case "$prev" in
8815 -i)
8816 _interfaces;
8817 return 0
8818 ;;
8819 esac;
8820 if [[ "$cur" == -* ]]; then
8821 COMPREPLY=($( compgen -W '-i -1 -2 -3 -4 -5 -6 -7 -8 -9' -- $cur ));
8822 fi
8823}
8824_tcpnice ()
8825{
8826 local cur;
8827 COMPREPLY=();
8828 cur=`_get_cword`;
8829 prev=${COMP_WORDS[COMP_CWORD-1]};
8830 case "$prev" in
8831 -i)
8832 _interfaces;
8833 return 0
8834 ;;
8835 esac;
8836 if [[ "$cur" == -* ]]; then
8837 COMPREPLY=($( compgen -W '-A -I -M -i' -- $cur ));
8838 fi
8839}
8840_tightvncviewer ()
8841{
8842 local cur prev;
8843 COMPREPLY=();
8844 cur=`_get_cword`;
8845 prev=${COMP_WORDS[COMP_CWORD-1]};
8846 case $prev in
8847 -passwd)
8848 _filedir;
8849 return 0
8850 ;;
8851 -encodings)
8852 COMPREPLY=($( compgen -W 'copyrect tight hextile zlib \
8853 corre rre raw' -- $cur ));
8854 return 0
8855 ;;
8856 -via)
8857 _known_hosts;
8858 return 0
8859 ;;
8860 esac;
8861 if [[ "$cur" == -* ]]; then
8862 COMPREPLY=($( compgen -W '-help -listen -via -shared -noshared\
8863 -viewonly -fullscreen -noraiseonbeep -passwd -encodings\
8864 -bgr233 -owncmap -truecolour -truecolor -depth \
8865 -compresslevel -quality -nojpeg -nocursorshape \
8866 -x11cursor' -- $cur ));
8867 else
8868 _known_hosts;
8869 fi
8870}
8871_ufw ()
8872{
8873 cur=${COMP_WORDS[COMP_CWORD]};
8874 prev=${COMP_WORDS[COMP_CWORD-1]};
8875 if [ $COMP_CWORD -eq 1 ]; then
8876 COMPREPLY=($( compgen -W "$(_ufw_commands)" $cur ));
8877 else
8878 if [ $COMP_CWORD -eq 2 ]; then
8879 case "$prev" in
8880 app)
8881 COMPREPLY=($( compgen -W "$(_ufw_app_commands)" $cur ))
8882 ;;
8883 status)
8884 COMPREPLY=($( compgen -W "$(_ufw_status_commands)" $cur ))
8885 ;;
8886 delete)
8887 COMPREPLY=($( compgen -W "$(_ufw_rule_commands)" $cur ))
8888 ;;
8889 logging)
8890 COMPREPLY=($( compgen -W "$(_ufw_logging_commands)" $cur ))
8891 ;;
8892 show)
8893 COMPREPLY=($( compgen -W "$(_ufw_show_commands)" $cur ))
8894 ;;
8895 default)
8896 COMPREPLY=($( compgen -W "$(_ufw_default_commands)" $cur ))
8897 ;;
8898 esac;
8899 fi;
8900 fi
8901}
8902_ufw_app_commands ()
8903{
8904 ufw --help | sed -e '1,/^Application profile commands:/d' -e '/^ [^ ]/!d' -e 's/[ \t]\+app[ \t]\+\([a-z|]\+\)[ \t]\+.*/\1/g'
8905}
8906_ufw_commands ()
8907{
8908 commands=$(ufw --help | sed -e '1,/^Commands:/d' -e '/^Application profile commands:/Q' -e 's/^[ \t]\+\([a-z|]\+\)[ \t]\+.*/\1/g' -e 's/|/ /g' | uniq);
8909 echo "$commands app"
8910}
8911_ufw_default_commands ()
8912{
8913 echo "allow deny reject"
8914}
8915_ufw_logging_commands ()
8916{
8917 echo "off on low medium high full"
8918}
8919_ufw_rule_commands ()
8920{
8921 echo "`_ufw_default_commands` limit"
8922}
8923_ufw_show_commands ()
8924{
8925 echo "raw"
8926}
8927_ufw_status_commands ()
8928{
8929 echo "numbered verbose"
8930}
8931_uids ()
8932{
8933 if type getent &>/dev/null; then
8934 COMPREPLY=($( getent passwd | awk -F: '{if ($3 ~ /^'$cur'/) print $3}' ));
8935 else
8936 if type perl &>/dev/null; then
8937 COMPREPLY=($( compgen -W '$( perl -e '"'"'while (($uid) = (getpwent)[2]) { print $uid . "\n" }'"'"' )' -- $cur ));
8938 else
8939 COMPREPLY=($( awk 'BEGIN {FS=":"} {if ($3 ~ /^'$cur'/) print $3}' /etc/passwd ));
8940 fi;
8941 fi
8942}
8943_umount ()
8944{
8945 local cur IFS='
8946';
8947 COMPREPLY=();
8948 cur=`_get_cword`;
8949 COMPREPLY=($( compgen -W '$( mount | cut -d" " -f 3 )' -- $cur ));
8950 return 0
8951}
8952_unace ()
8953{
8954 local cur;
8955 COMPREPLY=();
8956 cur=`_get_cword`;
8957 case "$cur" in
8958 -*)
8959 COMPREPLY=($( compgen -W '-c -c- -f -f- -o -o- -p -y -y-' -- $cur ))
8960 ;;
8961 *)
8962 if [ $COMP_CWORD -eq 1 ]; then
8963 COMPREPLY=($( compgen -W 'e l t v x' -- $cur ));
8964 else
8965 _filedir '@(ace|ACE)';
8966 fi
8967 ;;
8968 esac;
8969 return 0
8970}
8971_unrar ()
8972{
8973 local cur;
8974 COMPREPLY=();
8975 cur=`_get_cword`;
8976 case "$cur" in
8977 -*)
8978 COMPREPLY=($( compgen -W '-ad -ap -av- -c- -cfg- -cl -cu \
8979 -dh -ep -f -idp -ierr -inul -kb -o+ -o- -ow -p -p- -r -ta \
8980 -tb -tn -to -u -v -ver -vp -x -x@ -y' -- $cur ))
8981 ;;
8982 *)
8983 if [ $COMP_CWORD -eq 1 ]; then
8984 COMPREPLY=($( compgen -W 'e l lb lt p t v vb vt x' -- $cur ));
8985 else
8986 _filedir '@(rar|RAR)';
8987 fi
8988 ;;
8989 esac;
8990 return 0
8991}
8992_unshunt ()
8993{
8994 local cur;
8995 COMPREPLY=();
8996 cur=`_get_cword`;
8997 if [[ "$cur" == -* ]]; then
8998 COMPREPLY=($( compgen -W '-h --help' -- $cur ));
8999 else
9000 _filedir -d;
9001 fi
9002}
9003_update_alternatives ()
9004{
9005 local cur prev mode args i;
9006 COMPREPLY=();
9007 cur=`_get_cword`;
9008 prev=${COMP_WORDS[COMP_CWORD-1]};
9009 case "$prev" in
9010 --@(altdir|admindir))
9011 _filedir -d;
9012 return 0
9013 ;;
9014 --@(help|version))
9015 return 0
9016 ;;
9017 esac;
9018 for ((i=1; i < COMP_CWORD; i++ ))
9019 do
9020 if [[ "${COMP_WORDS[i]}" == --@(install|remove|auto|display|config|remove-all) ]]; then
9021 mode=${COMP_WORDS[i]};
9022 args=$(($COMP_CWORD - i));
9023 break;
9024 fi;
9025 done;
9026 case $mode in
9027 --install)
9028 case $args in
9029 1)
9030 _filedir
9031 ;;
9032 2)
9033 installed_alternatives
9034 ;;
9035 3)
9036 _filedir
9037 ;;
9038 esac
9039 ;;
9040 --remove)
9041 case $args in
9042 1)
9043 installed_alternatives
9044 ;;
9045 2)
9046 _filedir
9047 ;;
9048 esac
9049 ;;
9050 --auto)
9051 installed_alternatives
9052 ;;
9053 --remove-all)
9054 installed_alternatives
9055 ;;
9056 --display)
9057 installed_alternatives
9058 ;;
9059 --config)
9060 installed_alternatives
9061 ;;
9062 *)
9063 COMPREPLY=($( compgen -W '--verbose --quiet --help --version \
9064 --altdir --admindir' -- $cur ) $( compgen -W '--install --remove --auto --display \
9065 --config' -- $cur ))
9066 ;;
9067 esac
9068}
9069_update_rc_d ()
9070{
9071 local cur prev sysvdir services options valid_options;
9072 cur=`_get_cword`;
9073 prev=${COMP_WORDS[COMP_CWORD-1]};
9074 [ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d || sysvdir=/etc/init.d;
9075 services=($(echo $sysvdir/!(README*|*.sh|*.dpkg*|*.rpm@(orig|new|save))));
9076 services=(${services[@]#$sysvdir/});
9077 options=(-f -n);
9078 if [[ $COMP_CWORD -eq 1 || "$prev" == -* ]]; then
9079 valid_options=($( echo "${COMP_WORDS[@]} ${options[@]}" | tr " " "\n" | sed -ne "/$( echo "${options[@]}" | sed "s/ /\\|/g" )/p" | sort | uniq -u ));
9080 COMPREPLY=($( compgen -W '${options[@]} ${services[@]}' -X '$( echo ${COMP_WORDS[@]} | tr " " "|" )' -- $cur ));
9081 else
9082 if [[ "$prev" == ?($( echo ${services[@]} | tr " " "|" )) ]]; then
9083 COMPREPLY=($( compgen -W 'remove defaults start stop' -- $cur ));
9084 else
9085 if [[ "$prev" == defaults && "$cur" == [0-9] ]]; then
9086 COMPREPLY=(0 1 2 3 4 5 6 7 8 9);
9087 else
9088 if [[ "$prev" == defaults && "$cur" == [sk]?([0-9]) ]]; then
9089 COMPREPLY=(0 1 2 3 4 5 6 7 8 9);
9090 else
9091 if [[ "$prev" == defaults && -z "$cur" ]]; then
9092 COMPREPLY=(0 1 2 3 4 5 6 7 8 9 s k);
9093 else
9094 if [[ "$prev" == ?(start|stop) ]]; then
9095 if [[ "$cur" == [0-9] || -z "$cur" ]]; then
9096 COMPREPLY=(0 1 2 3 4 5 6 7 8 9);
9097 else
9098 if [[ "$cur" == [0-9][0-9] ]]; then
9099 COMPREPLY=($cur);
9100 else
9101 COMPREPLY=();
9102 fi;
9103 fi;
9104 else
9105 if [[ "$prev" == ?([0-9][0-9]|[0-6S]) ]]; then
9106 if [[ -z "$cur" ]]; then
9107 if [[ $prev == [0-9][0-9] ]]; then
9108 COMPREPLY=(0 1 2 3 4 5 6 S);
9109 else
9110 COMPREPLY=(0 1 2 3 4 5 6 S .);
9111 fi;
9112 else
9113 if [[ "$cur" == [0-6S.] ]]; then
9114 COMPREPLY=($cur);
9115 else
9116 COMPREPLY=();
9117 fi;
9118 fi;
9119 else
9120 if [[ "$prev" == "." ]]; then
9121 COMPREPLY=($(compgen -W "start stop" -- $cur));
9122 else
9123 COMPREPLY=();
9124 fi;
9125 fi;
9126 fi;
9127 fi;
9128 fi;
9129 fi;
9130 fi;
9131 fi;
9132 return 0
9133}
9134_urlsnarf ()
9135{
9136 local cur;
9137 COMPREPLY=();
9138 cur=`_get_cword`;
9139 prev=${COMP_WORDS[COMP_CWORD-1]};
9140 case "$prev" in
9141 -i)
9142 _interfaces;
9143 return 0
9144 ;;
9145 esac;
9146 if [[ "$cur" == -* ]]; then
9147 COMPREPLY=($( compgen -W '-n -i -v' -- $cur ));
9148 fi
9149}
9150_usb_ids ()
9151{
9152 COMPREPLY=(${COMPREPLY[@]:-} $( compgen -W "$( lsusb | awk '{print $6}')" -- $cur ))
9153}
9154_user_at_host ()
9155{
9156 local cur;
9157 COMPREPLY=();
9158 cur=`_get_cword`;
9159 if [[ $cur == *@* ]]; then
9160 _known_hosts;
9161 else
9162 COMPREPLY=($( compgen -u -- "$cur" ));
9163 fi;
9164 return 0
9165}
9166_usergroup ()
9167{
9168 local IFS='
9169';
9170 cur=${cur//\\\\ / };
9171 if [[ $cur = *@(\\:|.)* ]] && [ -n "$bash205" ]; then
9172 user=${cur%%*([^:.])};
9173 COMPREPLY=($(compgen -P ${user/\\\\} -g -- ${cur##*[.:]}));
9174 else
9175 if [[ $cur = *:* ]] && [ -n "$bash205" ]; then
9176 COMPREPLY=($( compgen -g -- ${cur##*[.:]} ));
9177 else
9178 COMPREPLY=($( compgen -S : -u -- $cur ));
9179 fi;
9180 fi
9181}
9182_vncviewer_bootstrap ()
9183{
9184 local fname;
9185 case "$(_realcommand vncviewer)" in
9186 '')
9187 _filedir `_get_cword`
9188 ;;
9189 *xvnc4viewer)
9190 fname=_xvnc4viewer
9191 ;;
9192 *tightvncviewer | *)
9193 fname=_tightvncviewer
9194 ;;
9195 esac;
9196 if [ $fname ]; then
9197 complete -F $fname vncviewer;
9198 $fname;
9199 unset -f _vncviewer_bootstrap;
9200 fi
9201}
9202_webmitm ()
9203{
9204 local cur;
9205 COMPREPLY=();
9206 cur=`_get_cword`;
9207 if [[ "$cur" == -* ]]; then
9208 COMPREPLY=($( compgen -W '-d' -- $cur ));
9209 else
9210 _known_hosts;
9211 fi
9212}
9213_withlist ()
9214{
9215 local cur;
9216 COMPREPLY=();
9217 cur=`_get_cword`;
9218 if [[ "$cur" == -* ]]; then
9219 COMPREPLY=($( compgen -W '-l --lock -i --interactive \
9220 -r --run -a --all -q --quiet -h --help' -- $cur ));
9221 else
9222 _mailman_lists;
9223 fi
9224}
9225_xvnc4viewer ()
9226{
9227 local cur prev;
9228 COMPREPLY=();
9229 cur=`_get_cword`;
9230 prev=${COMP_WORDS[COMP_CWORD-1]};
9231 case ${prev/#--/-} in
9232 -[pP][aA][sS][sS][wW][dD] | -[pP][aA][sS][sS][wW][oO][rR][dD][fF][iI][lL][eE])
9233 _filedir;
9234 return 0
9235 ;;
9236 -[pP][rR][eE][fF][eE][rR][rR][eE][dD][eE][nN][cC][oO][dD][iI][nN][gG])
9237 COMPREPLY=($( compgen -W 'zrle hextile raw' -- $cur ));
9238 return 0
9239 ;;
9240 -[vV][iI][aA])
9241 _known_hosts;
9242 return 0
9243 ;;
9244 esac;
9245 if [[ "$cur" == -* || "$cur" == --* ]]; then
9246 local dash options=(AcceptClipboard AutoSelect DebugDelay display DotWhenNoCursor FullColor FullColour FullScreen geometry help listen Log LowColourLevel MenuKey name Parent passwd PasswordFile PointerEventInterval PreferredEncoding SendClipboard SendPrimary Shared UseLocalCursor via ViewOnly WMDecorationHeight WMDecorationWidth ZlibLevel);
9247 [[ "$cur" == --* ]] && dash=-- || dash=-;
9248 if shopt nocasematch 2> /dev/null | grep --color=auto -q ^nocasematch; then
9249 local option oldNoCaseMatch=$(shopt -p nocasematch);
9250 shopt -s nocasematch;
9251 COMPREPLY=($( for option in "${options[@]}"; do
9252 [[ $dash$option == "$cur"* ]] && echo $dash$option
9253 done ));
9254 eval "$oldNoCaseMatch" 2> /dev/null;
9255 else
9256 COMPREPLY=($( compgen -W "$(
9257 echo ${options[@]/#/$dash} | tr [:upper:] [:lower:]
9258 )" -- "$(echo "$cur" | tr [:upper:] [:lower:])" ));
9259 fi;
9260 else
9261 _known_hosts;
9262 fi
9263}
9264_yum ()
9265{
9266 local cur prev special;
9267 COMPREPLY=();
9268 cur=`_get_cword`;
9269 prev=${COMP_WORDS[COMP_CWORD-1]};
9270 for ((i=0; i < ${#COMP_WORDS[@]}-1; i++ ))
9271 do
9272 if [[ ${COMP_WORDS[i]} == @(install|update|upgrade|remove|erase|deplist|info) ]]; then
9273 special=${COMP_WORDS[i]};
9274 fi;
9275 done;
9276 if [ -n "$special" ]; then
9277 case $special in
9278 install)
9279 _yum_list available;
9280 return 0
9281 ;;
9282 deplist | info)
9283 _yum_list all;
9284 return 0
9285 ;;
9286 upgrade | update)
9287 _yum_list updates;
9288 return 0
9289 ;;
9290 remove | erase)
9291 _yum_list installed;
9292 return 0
9293 ;;
9294 esac;
9295 fi;
9296 case $cur in
9297 --*)
9298 COMPREPLY=($( compgen -W '--installroot --version --help --enablerepo --disablerepo --exclude --obsoletes --noplugins' -- $cur ));
9299 return 0
9300 ;;
9301 -*)
9302 COMPREPLY=($( compgen -W '-c -e -d -y -t -R -C -h' -- $cur ));
9303 return 0
9304 ;;
9305 esac;
9306 case $prev in
9307 list)
9308 COMPREPLY=($( compgen -W 'all available updates installed extras obsoletes recent' -- $cur ))
9309 ;;
9310 clean)
9311 COMPREPLY=($( compgen -W 'packages headers metadata cache dbcache all' -- $cur ))
9312 ;;
9313 localinstall | localupdate)
9314 _filedir rpm
9315 ;;
9316 -c)
9317 _filedir
9318 ;;
9319 --installroot)
9320 _filedir -d
9321 ;;
9322 *)
9323 COMPREPLY=($( compgen -W 'install update check-update upgrade remove list \
9324 search info provides clean groupinstall groupupdate \
9325 grouplist deplist erase groupinfo groupremove \
9326 localinstall localupdate makecache resolvedep \
9327 shell whatprovides' -- $cur ))
9328 ;;
9329 esac
9330}
9331_yum_arch ()
9332{
9333 local cur;
9334 COMPREPLY=();
9335 cur=`_get_cword`;
9336 case "$cur" in
9337 -*)
9338 COMPREPLY=($( compgen -W '-d -v -vv -n -c -z -s -l -q' -- $cur ))
9339 ;;
9340 *)
9341 _filedir -d
9342 ;;
9343 esac;
9344 return 0
9345}
9346_yum_list ()
9347{
9348 if [[ "$1" == all ]]; then
9349 COMPREPLY=($( yum -d 0 -C list $1 "$cur*" 2>/dev/null | grep -iv '^\(Available\|Installed\|Updated\) Packages' | sed -e 's/[[:space:]].*//' ));
9350 else
9351 COMPREPLY=($( yum -d 0 -C list $1 "$cur*" 2>/dev/null | sed -ne 1d -e 's/[[:space:]].*//p' ));
9352 fi
9353}
9354command_not_found_handle ()
9355{
9356 if [ -x /usr/lib/command-not-found ]; then
9357 /usr/bin/python /usr/lib/command-not-found -- $1;
9358 return $?;
9359 else
9360 return 127;
9361 fi
9362}
9363dequote ()
9364{
9365 eval echo "$1"
9366}
9367get_entries ()
9368{
9369 local IFS='
9370';
9371 [ -r ${prefix:-}CVS/Entries ] && entries=$(cut -d/ -f2 -s ${prefix:-}CVS/Entries)
9372}
9373get_modules ()
9374{
9375 if [ -n "$prefix" ]; then
9376 COMPREPLY=($( command ls -d ${cvsroot}/${prefix}/!(CVSROOT) ));
9377 else
9378 COMPREPLY=($( command ls -d ${cvsroot}/!(CVSROOT) ));
9379 fi
9380}
9381installed_alternatives ()
9382{
9383 local admindir;
9384 for i in alternatives dpkg/alternatives rpm/alternatives;
9385 do
9386 [ -d /var/lib/$i ] && admindir=/var/lib/$i && break;
9387 done;
9388 for ((i=1; i < COMP_CWORD; i++ ))
9389 do
9390 if [[ "${COMP_WORDS[i]}" == --admindir ]]; then
9391 admindir=${COMP_WORDS[i+1]};
9392 break;
9393 fi;
9394 done;
9395 COMPREPLY=($( command ls $admindir | grep "^$cur" ))
9396}
9397quote ()
9398{
9399 echo \'${1//\'/\'\\\'\'}\'
9400}
9401quote_readline ()
9402{
9403 if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then
9404 echo "${1}";
9405 return;
9406 fi;
9407 local t="${1//\\/\\\\}";
9408 echo \'${t//\'/\'\\\'\'}\'
9409}
9410ri_get_methods ()
9411{
9412 local regex;
9413 if [ "$ri_version" = integrated ]; then
9414 if [ -z "$separator" ]; then
9415 regex="(Instance|Class)";
9416 else
9417 if [ "$separator" = "#" ]; then
9418 regex=Instance;
9419 else
9420 regex=Class;
9421 fi;
9422 fi;
9423 COMPREPLY=(${COMPREPLY[@]} "$( ri ${classes[@]} 2>/dev/null | ruby -ane 'if /^'"$regex"' methods:/.../^------------------|^$/ and \
9424 /^ / then print $_.split(/, |,$/).grep(/^[^\[]*$/).join("\n"); \
9425 end' | sort -u )");
9426 else
9427 COMPREPLY=(${COMPREPLY[@]} "$( ruby -W0 $ri_path ${classes[@]} | ruby -ane 'if /^-/.../^-/ and \
9428 ! /^-/ and ! /^ +(class|module): / then \
9429 print $_.split(/, |,$| +/).grep(/^[^\[]*$/).join("\n"); \
9430 end' | sort -u )");
9431 fi;
9432 COMPREPLY=($( compgen $prefix -W '${COMPREPLY[@]}' -- $method ))
9433}
9434set_prefix ()
9435{
9436 [ -z ${prefix:-} ] || prefix=${cur%/*}/;
9437 [ -r ${prefix:-}CVS/Entries ] || prefix=""
9438}
9439]0;netfpga@node1-1: ~netfpga@node1-1:~$ cler
9440No command 'cler' found, did you mean:
9441 Command 'cver' from package 'gplcver' (universe)
9442 Command 'clex' from package 'clex' (universe)
9443 Command 'clear' from package 'ncurses-bin' (main)
9444cler: command not found
9445]0;netfpga@node1-1: ~netfpga@node1-1:~$ cker
9446No command 'cker' found, did you mean:
9447 Command 'cver' from package 'gplcver' (universe)
9448cker: command not found
9449]0;netfpga@node1-1: ~netfpga@node1-1:~$ echo $PERL5LIB
9450/home/netfpga/netfpga/projects/reference_nic/lib/Perl5:/home/netfpga/netfpga/lib/Perl5:
9451]0;netfpga@node1-1: ~netfpga@node1-1:~$ echo $PERL5LIBcker[Kler[1Psetudo -E netfpga/bin/nf_regress_test.pl --project driver
9452Can't locate NF/Base.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at netfpga/bin/nf_regress_test.pl line 3.
9453BEGIN failed--compilation aborted at netfpga/bin/nf_regress_test.pl line 3.
9454]0;netfpga@node1-1: ~netfpga@node1-1:~$ sudo -E netfpga/bin/nf_regress_test.pl --project driver
9455[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cecho $PERL5LIB[Kcker[Kler[1Psetudo -E netfpga/bin/nf_regress_test.pl --project driver
9456[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cman sudo[K
9457[?1049h[?1h=
9458SUDO(8) MAINTENANCE COMMANDS SUDO(8)[m
9459[m
9460[1mNAME[0m[m
9461 sudo, sudoedit - execute a command as another user[m
9462[m
9463[1mSYNOPSIS[0m[m
9464 [1msudo[0m [[1m-n[0m] [1m-h[0m | [1m-K[0m | [1m-k[0m | [1m-L[0m | [1m-V[0m | [1m-v[0m[m
9465[m
9466 [1msudo[0m [1m-l[l][0m [[1m-AnS[0m] [[1m-g[0m [4mgroupname[24m|[4m#gid[24m] [[1m-U[0m [4musername[24m] [[1m-u[0m [4musername[24m|[4m#uid[24m][m
9467 [[4mcommand[24m][m
9468[m
9469 [1msudo[0m [[1m-AbEHnPS[0m] [[1m-a[0m [4mauth_type[24m] [[1m-C[0m [4mfd[24m] [[1m-c[0m [4mclass[24m|[4m-[24m] [[1m-g[0m [4mgroupname[24m|[4m#gid[24m][m
9470 [[1m-p[0m [4mprompt[24m] [[1m-r[0m [4mrole[24m] [[1m-t[0m [4mtype[24m] [[1m-u[0m [4musername[24m|[4m#uid[24m] [[1mVAR[0m=[4mvalue[24m][m
9471 [[1m-i[0m | [1m-s[0m] [[4mcommand[24m][m
9472[m
9473 [1msudoedit[0m [[1m-AnS[0m] [[1m-a[0m [4mauth_type[24m] [[1m-C[0m [4mfd[24m] [[1m-c[0m [4mclass[24m|[4m-[24m] [[1m-g[0m [4mgroupname[24m|[4m#gid[24m][m
9474 [[1m-p[0m [4mprompt[24m] [[1m-u[0m [4musername[24m|[4m#uid[24m] file ...[m
9475[m
9476[1mDESCRIPTION[0m[m
9477 [1msudo[0m allows a permitted user to execute a [4mcommand[24m as the superuser or[m
9478 another user, as specified in the [4msudoers[24m file. The real and effective[m
9479 uid and gid are set to match those of the target user as specified in[m
9480 the passwd file and the group vector is initialized based on the group[m
9481[7m Manual page sudo(8) line 1[27m[K
9482[K file (unless the [1m-P[0m option was specified). If the invoking user is[m
9483 root or if the target user is the same as the invoking user, no[m
9484 password is required. Otherwise, [1msudo[0m requires that users authenticate[m
9485 themselves with a password by default (NOTE: in the default[m
9486 configuration this is the user's password, not the root password).[m
9487 Once a user has been authenticated, a timestamp is updated and the user[m
9488 may then use sudo without a password for a short period of time (15[m
9489 minutes unless overridden in [4msudoers[24m).[m
9490[m
9491 When invoked as [1msudoedit[0m, the [1m-e[0m option (described below), is implied.[m
9492[m
9493 [1msudo[0m determines who is an authorized user by consulting the file[m
9494 [4m@sysconfdir@/sudoers[24m. By running [1msudo[0m with the [1m-v[0m option, a user can[m
9495 update the time stamp without running a [4mcommand[24m. The password prompt[m
9496 itself will also time out if the user's password is not entered within[m
9497 0 minutes (unless overridden via [4msudoers[24m).[m
9498[m
9499 If a user who is not listed in the [4msudoers[24m file tries to run a command[m
9500 via [1msudo[0m, mail is sent to the proper authorities, as defined at[m
9501 configure time or in the [4msudoers[24m file (defaults to root). Note that[m
9502 the mail will not be sent if an unauthorized user tries to run sudo[m
9503 with the [1m-l[0m or [1m-v[0m option. This allows users to determine for[m
9504 themselves whether or not they are allowed to use [1msudo[0m.[m
9505[7m Manual page sudo(8) line 26[27m[K
9506[K[m
9507 If [1msudo[0m is run by root and the SUDO_USER environment variable is set,[m
9508 [1msudo[0m will use this value to determine who the actual user is. This can[m
9509 be used by a user to log commands through sudo even when a root shell[m
9510 has been invoked. It also allows the [1m-e[0m option to remain useful even[m
9511 when being run via a sudo-run script or program. Note however, that[m
9512 the sudoers lookup is still done for root, not the user specified by[m
9513 SUDO_USER.[m
9514[m
9515 [1msudo[0m can log both successful and unsuccessful attempts (as well as[m
9516 errors) to [4msyslog[24m(3), a log file, or both. By default [1msudo[0m will log[m
9517 via [4msyslog[24m(3) but this is changeable at configure time or via the[m
9518 [4msudoers[24m file.[m
9519[m
9520[1mOPTIONS[0m[m
9521 [1msudo[0m accepts the following command line options:[m
9522[m
9523 -A Normally, if [1msudo[0m requires a password, it will read it from[m
9524 the current terminal. If the [1m-A[0m ([4maskpass[24m) option is[m
9525 specified, a helper program is executed to read the user's[m
9526 password and output the password to the standard output.[m
9527 If the SUDO_ASKPASS environment variable is set, it[m
9528 specifies the path to the helper program. Otherwise, the[m
9529[7m Manual page sudo(8) line 49[27m[K
9530[K value specified by the [4maskpass[24m option in [4msudoers[24m(5) is[m
9531 used.[m
9532[m
9533 -a [4mtype[24m The [1m-a[0m ([4mauthentication[24m [4mtype[24m) option causes [1msudo[0m to use the[m
9534 specified authentication type when validating the user, as[m
9535 allowed by [4m/etc/login.conf[24m. The system administrator may[m
9536 specify a list of sudo-specific authentication methods by[m
9537 adding an "auth-sudo" entry in [4m/etc/login.conf[24m. This[m
9538 option is only available on systems that support BSD[m
9539 authentication.[m
9540[m
9541 -b The [1m-b[0m ([4mbackground[24m) option tells [1msudo[0m to run the given[m
9542 command in the background. Note that if you use the [1m-b[0m[m
9543 option you cannot use shell job control to manipulate the[m
9544 process.[m
9545[m
9546 -C [4mfd[24m Normally, [1msudo[0m will close all open file descriptors other[m
9547 than standard input, standard output and standard error.[m
9548 The [1m-C[0m ([4mclose[24m [4mfrom[24m) option allows the user to specify a[m
9549 starting point above the standard error (file descriptor[m
9550 three). Values less than three are not permitted. This[m
9551 option is only available if the administrator has enabled[m
9552 the [4mclosefrom_override[24m option in [4msudoers[24m(5).[m
9553[7m Manual page sudo(8) line 72[27m[K
9554[K [KESCESC[KOO[KBB
9555[K[m
9556[7m Manual page sudo(8) line 73[27m[K
9557[K [KESCESC[KOO[KBB
9558[K -c [4mclass[24m The [1m-c[0m ([4mclass[24m) option causes [1msudo[0m to run the specified[m
9559[7m Manual page sudo(8) line 74[27m[K
9560[K [KESCESC[KOO[KBB
9561[K command with resources limited by the specified login[m
9562[7m Manual page sudo(8) line 75[27m[K
9563[K [KESCESC[KOO[KBB
9564[K class. The [4mclass[24m argument can be either a class name as[m
9565[7m Manual page sudo(8) line 76[27m[K
9566[K [KESCESC[KOO[KBB
9567[K defined in [4m/etc/login.conf[24m, or a single '-' character.[m
9568[7m Manual page sudo(8) line 77[27m[K
9569[K [KESCESC[KOO[KBB
9570[K Specifying a [4mclass[24m of - indicates that the command should[m
9571[7m Manual page sudo(8) line 78[27m[K
9572[K [KESCESC[KOO[KBB
9573[K be run restricted by the default login capabilities for the[m
9574[7m Manual page sudo(8) line 79[27m[K
9575[K [KESCESC[KOO[KBB
9576[K user the command is run as. If the [4mclass[24m argument[m
9577[7m Manual page sudo(8) line 80[27m[K
9578[K [KESCESC[KOO[KBB
9579[K specifies an existing user class, the command must be run[m
9580[7m Manual page sudo(8) line 81[27m[K
9581[K [KESCESC[KOO[KBB
9582[K as root, or the [1msudo[0m command must be run from a shell that[m
9583[7m Manual page sudo(8) line 82[27m[K
9584[K [KESCESC[KOO[KBB
9585[K is already root. This option is only available on systems[m
9586[7m Manual page sudo(8) line 83[27m[K
9587[K [KESCESC[KOO[KBB
9588[K with BSD login classes.[m
9589[7m Manual page sudo(8) line 84[27m[K
9590[K [KESCESC[KOO[KBB
9591[K[m
9592[7m Manual page sudo(8) line 85[27m[K
9593[K [KESCESC[KOO[KBB
9594[K -E The [1m-E[0m ([4mpreserve[24m [4menvironment[24m) option will override the[m
9595[7m Manual page sudo(8) line 86[27m[K
9596[K [KESCESC[KOO[KBB
9597[K [4menv_reset[24m option in [4msudoers[24m(5)). It is only available when[m
9598[7m Manual page sudo(8) line 87[27m[K
9599[K [KESCESC[KOO[KBB
9600[K either the matching command has the SETENV tag or the[m
9601[7m Manual page sudo(8) line 88[27m[K
9602[K [KESCESC[KOO[KBB
9603[K [4msetenv[24m option is set in [4msudoers[24m(5).[m
9604[7m Manual page sudo(8) line 89[27m[K
9605[K [KESCESC[KOO[KBB
9606[K[m
9607[7m Manual page sudo(8) line 90[27m[K
9608[K [KESCESC[KOO[KBB
9609[K -e The [1m-e[0m ([4medit[24m) option indicates that, instead of running a[m
9610[7m Manual page sudo(8) line 91[27m[K
9611[K [KESCESC[KOO[KBB
9612[K command, the user wishes to edit one or more files. In[m
9613[7m Manual page sudo(8) line 92[27m[K
9614[K [KESCESC[KOO[KBB
9615[K lieu of a command, the string "sudoedit" is used when[m
9616[7m Manual page sudo(8) line 93[27m[K
9617[K [KESCESC[KOO[KBB
9618[K consulting the [4msudoers[24m file. If the user is authorized by[m
9619[7m Manual page sudo(8) line 94[27m[K
9620[K [KESCESC[KOO[KBB
9621[K [4msudoers[24m the following steps are taken:[m
9622[7m Manual page sudo(8) line 95[27m[K
9623[K [KESCESC[KOO[KBB
9624[K[m
9625[7m Manual page sudo(8) line 96[27m[K
9626[K [KESCESC[KOO[KBB
9627[K 1. Temporary copies are made of the files to be edited[m
9628[7m Manual page sudo(8) line 97[27m[K
9629[K [KESCESC[KOO[KBB
9630[K with the owner set to the invoking user.[m
9631[7m Manual page sudo(8) line 98[27m[K
9632[K [KESCESC[KOO[KBB
9633[K[m
9634[7m Manual page sudo(8) line 99[27m[K
9635[K [KESCESC[KOO[KBB
9636[K 2. The editor specified by the SUDO_EDITOR, VISUAL or[m
9637[7m Manual page sudo(8) line 100[27m[K
9638[K [KESCESC[KOO[KBB
9639[K EDITOR environment variables is run to edit the[m
9640[7m Manual page sudo(8) line 101[27m[K
9641[K [KESCESC[KOO[KBB
9642[K temporary files. If none of SUDO_EDITOR, VISUAL or[m
9643[7m Manual page sudo(8) line 102[27m[K
9644[K[?1l>[?1049l]0;netfpga@node1-1: ~netfpga@node1-1:~$ man 5 sudoers
9645[?1049h[?1h=
9646SUDOERS(5) MAINTENANCE COMMANDS SUDOERS(5)[m
9647[m
9648[1mNAME[0m[m
9649 sudoers - list of which users may execute what[m
9650[m
9651[1mDESCRIPTION[0m[m
9652 The [4msudoers[24m file is composed of two types of entries: aliases[m
9653 (basically variables) and user specifications (which specify who may[m
9654 run what).[m
9655[m
9656 When multiple entries match for a user, they are applied in order.[m
9657 Where there are multiple matches, the last match is used (which is not[m
9658 necessarily the most specific match).[m
9659[m
9660 The [4msudoers[24m grammar will be described below in Extended Backus-Naur[m
9661 Form (EBNF). Don't despair if you don't know what EBNF is; it is[m
9662 fairly simple, and the definitions below are annotated.[m
9663[m
9664 [1mQuick[0m [1mguide[0m [1mto[0m [1mEBNF[0m[m
9665 EBNF is a concise and exact way of describing the grammar of a[m
9666 language. Each EBNF definition is made up of [4mproduction[24m [4mrules[24m. E.g.,[m
9667[m
9668 symbol ::= definition | alternate1 | alternate2 ...[m
9669[7m Manual page sudoers(5) line 1[27m[K
9670[K/[Kss[Kee[Ktt[Kee[Knn[Kvv
9671[K[1;1HSUDOERS(5) MAINTENANCE COMMANDS SUDOERS(5)[m
9672[2;1H[m
9673[3;1H[1mNAME[0m[m
9674[4;1H sudoers - list of which users may execute what[m
9675[5;1H[m
9676[6;1H[1mDESCRIPTION[0m[m
9677[7;1H The [4msudoers[24m file is composed of two types of entries: aliases[m
9678[8;1H (basically variables) and user specifications (which specify who may[m
9679[9;1H run what).[m
9680[10;1H[m
9681[11;1H When multiple entries match for a user, they are applied in order.[m
9682[12;1H Where there are multiple matches, the last match is used (which is not[m
9683[13;1H necessarily the most specific match).[m
9684[14;1H[m
9685[15;1H The [4msudoers[24m grammar will be described below in Extended Backus-Naur[m
9686[16;1H Form (EBNF). Don't despair if you don't know what EBNF is; it is[m
9687[17;1H fairly simple, and the definitions below are annotated.[m
9688[18;1H[m
9689[19;1H [1mQuick[0m [1mguide[0m [1mto[0m [1mEBNF[0m[m
9690[20;1H EBNF is a concise and exact way of describing the grammar of a[m
9691[21;1H language. Each EBNF definition is made up of [4mproduction[24m [4mrules[24m. E.g.,[m
9692[22;1H[m
9693[23;1H symbol ::= definition | alternate1 | alternate2 ...[m
9694[24;1H[1;1HSUDOERS(5) MAINTENANCE COMMANDS SUDOERS(5)[m
9695[2;1H[m
9696[3;1H[1mNAME[0m[m
9697[4;1H sudoers - list of which users may execute what[m
9698[5;1H[m
9699[6;1H[1mDESCRIPTION[0m[m
9700[7;1H The [4msudoers[24m file is composed of two types of entries: aliases[m
9701[8;1H (basically variables) and user specifications (which specify who may[m
9702[9;1H run what).[m
9703[10;1H[m
9704[11;1H When multiple entries match for a user, they are applied in order.[m
9705[12;1H Where there are multiple matches, the last match is used (which is not[m
9706[13;1H necessarily the most specific match).[m
9707[14;1H[m
9708[15;1H The [4msudoers[24m grammar will be described below in Extended Backus-Naur[m
9709[16;1H Form (EBNF). Don't despair if you don't know what EBNF is; it is[m
9710[17;1H fairly simple, and the definitions below are annotated.[m
9711[18;1H[m
9712[19;1H [1mQuick[0m [1mguide[0m [1mto[0m [1mEBNF[0m[m
9713[20;1H EBNF is a concise and exact way of describing the grammar of a[m
9714[21;1H language. Each EBNF definition is made up of [4mproduction[24m [4mrules[24m. E.g.,[m
9715[22;1H[m
9716[23;1H symbol ::= definition | alternate1 | alternate2 ...[m
9717[24;1H...skipping...
9718 '[7mSETENV[27m:' | 'NO[7mSETENV[27m:' )[m
9719[m
9720 A [1muser[0m [1mspecification[0m determines which commands a user may run (and as[m
9721 what user) on specified hosts. By default, commands are run as [1mroot[0m,[m
9722 but this can be changed on a per-command basis.[m
9723[m
9724 Let's break that down into its constituent parts:[m
9725[m
9726 [1mRunas_Spec[0m[m
9727 A Runas_Spec determines the user and/or the group that a command may be[m
9728 run as. A fully-specified Runas_Spec consists of two Runas_Lists (as[m
9729 defined above) separated by a colon (':') and enclosed in a set of[m
9730 parentheses. The first Runas_List indicates which users the command[m
9731 may be run as via [1msudo[0m's [1m-u[0m option. The second defines a list of[m
9732 groups that can be specified via [1msudo[0m's [1m-g[0m option. If both Runas_Lists[m
9733 are specified, the command may be run with any combination of users and[m
9734 groups listed in their respective Runas_Lists. If only the first is[m
9735 specified, the command may be run as any user in the list but no [1m-g[0m[m
9736 option may be specified. If the first Runas_List is empty but the[m
9737 second is specified, the command may be run as the invoking user with[m
9738 the group set to any listed in the Runas_List. If no Runas_Spec is[m
9739 specified the command may be run as [1mroot[0m and no group may be specified.[m
9740[m
9741[7m Manual page sudoers(5) line 216[27m[K
9742[K [KESCESC[KOO[KAA
9743[K[HM Tag_Spec ::= ('NOPASSWD:' | 'PASSWD:' | 'NOEXEC:' | 'EXEC:' |[m
9744[24;1H
9745[K[7m Manual page sudoers(5) line 215[27m[K
9746[K [KESCESC[KOO[KAA
9747[K[HM[m
9748[24;1H
9749[K[7m Manual page sudoers(5) line 214[27m[K
9750[K [KESCESC[KOO[KAA
9751[K[HM Runas_Spec ::= '(' Runas_List? (: Runas_List)? ')'[m
9752[24;1H
9753[K[7m Manual page sudoers(5) line 213[27m[K
9754[K [KESCESC[KOO[KAA
9755[K[HM[m
9756[24;1H
9757[K[7m Manual page sudoers(5) line 212[27m[K
9758[K [KESCESC[KOO[KAA
9759[K[HM Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd[m
9760[24;1H
9761[K[7m Manual page sudoers(5) line 211[27m[K
9762[K [KESCESC[KOO[KAA
9763[K[HM[m
9764[24;1H
9765[K[7m Manual page sudoers(5) line 210[27m[K
9766[K [KESCESC[KOO[KAA
9767[K[HM Cmnd_Spec ',' Cmnd_Spec_List[m
9768[24;1H
9769[K[7m Manual page sudoers(5) line 209[27m[K
9770[K [KESCESC[KOO[KAA
9771[K[HM Cmnd_Spec_List ::= Cmnd_Spec |[m
9772[24;1H
9773[K[7m Manual page sudoers(5) line 208[27m[K
9774[K [KESCESC[KOO[KAA
9775[K[HM[m
9776[24;1H
9777[K[7m Manual page sudoers(5) line 207[27m[K
9778[K [KESCESC[KOO[KAA
9779[K[HM (':' Host_List '=' Cmnd_Spec_List)*[m
9780[24;1H
9781[K[7m Manual page sudoers(5) line 206[27m[K
9782[K/
9783[K may be run as via [1msudo[0m's [1m-u[0m option. The second defines a list of[m
9784 groups that can be specified via [1msudo[0m's [1m-g[0m option. If both Runas_Lists[m
9785 are specified, the command may be run with any combination of users and[m
9786 groups listed in their respective Runas_Lists. If only the first is[m
9787 specified, the command may be run as any user in the list but no [1m-g[0m[m
9788 option may be specified. If the first Runas_List is empty but the[m
9789 second is specified, the command may be run as the invoking user with[m
9790 the group set to any listed in the Runas_List. If no Runas_Spec is[m
9791 specified the command may be run as [1mroot[0m and no group may be specified.[m
9792[m
9793[7m Manual page sudoers(5) line 216[27m[K
9794[K/
9795[K...skipping...
9796 eight possible tag values, NOPASSWD, PASSWD, NOEXEC, EXEC, [7mSETENV[27m and[m
9797 NO[7mSETENV[27m. Once a tag is set on a Cmnd, subsequent Cmnds in the[m
9798 Cmnd_Spec_List, inherit the tag unless it is overridden by the opposite[m
9799 tag (i.e.: PASSWD overrides NOPASSWD and NOEXEC overrides EXEC).[m
9800[m
9801 [4mNOPASSWD[24m [4mand[24m [4mPASSWD[24m[m
9802[m
9803 By default, [1msudo[0m requires that a user authenticate him or herself[m
9804 before running a command. This behavior can be modified via the[m
9805 NOPASSWD tag. Like a Runas_Spec, the NOPASSWD tag sets a default for[m
9806 the commands that follow it in the Cmnd_Spec_List. Conversely, the[m
9807 PASSWD tag can be used to reverse things. For example:[m
9808[m
9809 ray rushmore = NOPASSWD: /bin/kill, /bin/ls, /usr/bin/lprm[m
9810[m
9811 would allow the user [1mray[0m to run [4m/bin/kill[24m, [4m/bin/ls[24m, and [4m/usr/bin/lprm[24m[m
9812 as [1mroot[0m on the machine rushmore without authenticating himself. If we[m
9813 only want [1mray[0m to be able to run [4m/bin/kill[24m without a password the entry[m
9814 would be:[m
9815[m
9816 ray rushmore = NOPASSWD: /bin/kill, PASSWD: /bin/ls, /usr/bin/lprm[m
9817[m
9818 Note, however, that the PASSWD tag has no effect on users who are in[m
9819[7m Manual page sudoers(5) line 272[27m[K
9820[K [KESCESC[KOO[KAA
9821[K[HM A command may have zero or more tags associated with it. There are[m
9822[24;1H
9823[K[7m Manual page sudoers(5) line 271[27m[K
9824[K [KESCESC[KOO[KAA
9825[K[HM [1mTag_Spec[0m[m
9826[24;1H
9827[K[7m Manual page sudoers(5) line 270[27m[K
9828[K [KESCESC[KOO[KAA
9829[K[HM[m
9830[24;1H
9831[K[7m Manual page sudoers(5) line 269[27m[K
9832[K [KESCESC[KOO[KAA
9833[K[HM /usr/local/bin/minicom[m
9834[24;1H
9835[K[7m Manual page sudoers(5) line 268[27m[K
9836[K [KESCESC[KOO[KAA
9837[K[HM tcm boulder = (:dialer) /usr/bin/tip, /usr/bin/cu, \[m
9838[24;1H
9839[K[7m Manual page sudoers(5) line 267[27m[K
9840[K [KESCESC[KOO[KAA
9841[K[HM[m
9842[24;1H
9843[K[7m Manual page sudoers(5) line 266[27m[K
9844[K/
9845[K only want [1mray[0m to be able to run [4m/bin/kill[24m without a password the entry[m
9846 would be:[m
9847[m
9848 ray rushmore = NOPASSWD: /bin/kill, PASSWD: /bin/ls, /usr/bin/lprm[m
9849[m
9850 Note, however, that the PASSWD tag has no effect on users who are in[m
9851[7m Manual page sudoers(5) line 272[27m[K
9852[K/
9853[K the group specified by the [4mexempt_group[24m option.[m
9854[7m Manual page sudoers(5) line 273[27m[K
9855[K/
9856[K...skipping...
9857 [4m[7mSETENV[27m[24m [4mand[24m [4mNOSETENV[24m[m
9858[m
9859 These tags override the value of the [4m[7msetenv[27m[24m option on a per-command[m
9860 basis. Note that if [7mSETENV[27m has been set for a command, any environment[m
9861 variables set on the command line way are not subject to the[m
9862 restrictions imposed by [4menv_check[24m, [4menv_delete[24m, or [4menv_keep[24m. As such,[m
9863 only trusted users should be allowed to set variables in this manner.[m
9864 If the command matched is [1mALL[0m, the [7mSETENV[27m tag is implied for that[m
9865 command; this default may be overridden by use of the UN[7mSETENV[27m tag.[m
9866[m
9867 [1mWildcards[0m[m
9868 [1msudo[0m allows shell-style [4mwildcards[24m (aka meta or glob characters) to be[m
9869 used in hostnames, pathnames and command line arguments in the [4msudoers[24m[m
9870 file. Wildcard matching is done via the [1mPOSIX[0m [4mfnmatch[24m(3) routine.[m
9871 Note that these are [4mnot[24m regular expressions.[m
9872[m
9873 * Matches any set of zero or more characters.[m
9874[m
9875 ? Matches any single character.[m
9876[m
9877 [...] Matches any character in the specified range.[m
9878[m
9879 [!...] Matches any character [1mnot[0m in the specified range.[m
9880[7m Manual page sudoers(5) line 318[27m[K
9881[K [KESCESC[KOO[KAA
9882[K[HM[m
9883[24;1H
9884[K[7m Manual page sudoers(5) line 317[27m[K
9885[K [KESCESC[KOO[KAA
9886[K[HM how NOEXEC works and whether or not it will work on your system.[m
9887[24;1H
9888[K[7m Manual page sudoers(5) line 316[27m[K
9889[K [KESCESC[KOO[KAA
9890[K[HM See the "PREVENTING SHELL ESCAPES" section below for more details on[m
9891[24;1H
9892[K[7m Manual page sudoers(5) line 315[27m[K
9893[K[?1l>[?1049l]0;netfpga@node1-1: ~netfpga@node1-1:~$ man 5 sudoers[5Psudosudo -E netfpga/bin/nf_regress_test.pl --project driver
9894[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cman sudo[K[K[K[K[K[K[K[K[Ksudo vi /[K/etc/sudoers
9895[?1049h[?1h=[1;24r[?12;25h[?12l[?25h[27m[m[H[2J[?25l[24;1H"/etc/sudoers" [readonly] 26L, 619C[>c[1;1H[34m# /etc/sudoers
9896#
9897# This file MUST be edited with the 'visudo' command as root.
9898#
9899# See the man page for details on how to write a sudoers file.
9900#[m
9901
9902[33mDefaults[m[7C [36menv_reset[m
9903
9904[34m# Host alias specification
9905
9906# User alias specification
9907
9908# Cmnd alias specification
9909
9910# User privilege specification[m
9911[31mroot[m [35mALL[m[33m=[m[35m(ALL)[m [35mALL[m
9912[31mopenflow[m [35mALL[m[33m=[m[35m(ALL)[m [35mNOPASSWD:ALL[m
9913[31mnetfpga[m [35mALL[m[33m=[m[35m(ALL)[m [35mNOPASSWD:ALL[m
9914[34m# Uncomment to allow members of group sudo to not need a password
9915# (Note that later entries override this, so you might need to move
9916# it further down)
9917# %sudo ALL=NOPASSWD: ALL[m[24;63H1,1[11CTop[1;1H[?12l[?25hP+q436f\P+q6b75\P+q6b64\P+q6b72\P+q6b6c\P+q2332\P+q2334\P+q2569\P+q2a37\P+q6b31\P+q6b32\[27m[m[H[2J[?25l[1;1H[34m# /etc/sudoers
9918#
9919# This file MUST be edited with the 'visudo' command as root.
9920#
9921# See the man page for details on how to write a sudoers file.
9922#[m
9923
9924[38;5;130mDefaults[m[7C [36menv_reset[m
9925
9926[34m# Host alias specification
9927
9928# User alias specification
9929
9930# Cmnd alias specification
9931
9932# User privilege specification[m
9933[31mroot[m [35mALL[m[38;5;130m=[m[35m(ALL)[m [35mALL[m
9934[31mopenflow[m [35mALL[m[38;5;130m=[m[35m(ALL)[m [35mNOPASSWD:ALL[m
9935[31mnetfpga[m [35mALL[m[38;5;130m=[m[35m(ALL)[m [35mNOPASSWD:ALL[m
9936[34m# Uncomment to allow members of group sudo to not need a password
9937# (Note that later entries override this, so you might need to move
9938# it further down)
9939# %sudo ALL=NOPASSWD: ALL[m[24;63H1,1[11CTop
9940"/etc/sudoers" [readonly] 26L, 619C[24;63H[K[24;63H1,1[11CTop[1;1H[?12l[?25hP+q6b33\[?25l[?12l[?25hP+q6b34\P+q6b35\P+q6b36\P+q6b37\P+q6b38\P+q6b39\P+q6b3b\P+q4631\P+q4632\P+q2531\P+q2638\P+q6b62\P+q6b49\P+q6b44\P+q6b68\P+q4037\P+q6b50\P+q6b4e\P+q4b31\P+q4b33\P+q4b34\P+q4b35\P+q6b42\[?25l[24;63H2[2;1H[?12l[?25h[?25l[24;63H3[3;1H[?12l[?25h[?25l[24;63H4[4;1H[?12l[?25h[?25l[24;63H5[5;1H[?12l[?25h[?25l[24;63H6[6;1H[?12l[?25h[?25l[24;63H7,0-1[7;1H[?12l[?25h[?25l[24;63H8,1 [8;1H[?12l[?25h[?25l[24;63H9,0-1[9;1H[?12l[?25h[?25l[24;63H10,1 [10;1H[?12l[?25h[?25l[24;64H1,0-1[11;1H[?12l[?25h[?25l[24;64H2,1 [12;1H[?12l[?25h[?25l[24;64H3,0-1[13;1H[?12l[?25h[?25l[24;64H4,1 [14;1H[?12l[?25h[?25l[24;64H5,0-1[15;1H[?12l[?25h[?25l[24;64H6,1 [16;1H[?12l[?25h[?25l[24;64H7[17;1H[?12l[?25h[?25l[24;64H8[18;1H[?12l[?25h[?25l[24;64H9[19;1H[?12l[?25h[?25l[24;63H20[20;1H[?12l[?25h[?25l[24;64H1[21;1H[?12l[?25h[?25l[24;64H2[22;1H[?12l[?25h[?25l[24;64H3[23;1H[?12l[?25h[?25l[1;23r[23;1H
9941[1;24r[24;1H[K[24;63H24,0-1[8C33%[23;1H[?12l[?25h[?25l[1;23r[23;1H
9942[1;24r[23;1H[34m# Members of the admin group may gain root privileges[m[24;63H[K[24;63H25,1[10C66%[23;1H[?12l[?25h[?25l[1;23r[23;1H
9943[1;24r[23;1H[35m%admin[m [35mALL[m[38;5;130m=[m[35m(ALL)[m [35mALL[m[24;63H[K[24;63H26,1[10CBot[23;1H[?12l[?25h[?25l[24;64H5[22;1H[?12l[?25h[?25l[24;64H4,0-1[21;1H[?12l[?25h[?25l[24;64H3,1 [20;1H[?12l[?25h[?25l[24;64H2[19;1H[?12l[?25h[?25l[24;64H1[18;1H[?12l[?25h[?25l[24;64H0[17;1H[?12l[?25h[?25l[24;63H19[16;1H[?12l[?25h[?25l[24;64H8[15;1H[?12l[?25h[?25l[24;64H7[14;1H[?12l[?25h[?25l[24;64H6[13;1H[?12l[?25h[?25l[24;64H5,0-1[12;1H[?12l[?25h[?25l[24;64H4,1 [11;1H[?12l[?25h[?25l[24;64H3,0-1[10;1H[?12l[?25h[?25l[24;64H2,1 [9;1H[?12l[?25h[?25l[24;64H1,0-1[8;1H[?12l[?25h[?25l[24;64H0,1 [7;1H[?12l[?25h[?25l[24;63H9,0-1[6;1H[?12l[?25h[?25l[24;63H8,1 [5;1H[?12l[?25h[?25l[24;63H7,0-1[4;1H[?12l[?25h[?25l[24;63H6,1 [3;1H[?12l[?25h[?25l[24;63H5[2;1H[?12l[?25h[?25l[24;63H4[1;1H[?12l[?25h[?25l[1;23r[1;1H[L[1;24r[1;1H[34m# This file MUST be edited with the 'visudo' command as root.[m[24;63H[K[24;63H3,1[11C66%[1;1H[?12l[?25h[?25l[1;23r[1;1H[L[1;24r[1;1H[34m#[m[24;63H[K[24;63H2,1[11C33%[1;1H[?12l[?25h[?25l[1;23r[1;1H[L[1;24r[1;1H[34m# /etc/sudoers[m[24;63H[K[24;63H1,1[11CTop[1;1H[?12l[?25h[?25l[24;63H2[2;1H[?12l[?25h[?25l[24;63H3[3;1H[?12l[?25h[?25l[24;63H4[4;1H[?12l[?25h[?25l[24;63H5[5;1H[?12l[?25h[?25l[24;63H6[6;1H[?12l[?25h[?25l[24;63H7,0-1[7;1H[?12l[?25h[?25l[24;63H8,1 [8;1H[?12l[?25h[?25l[24;63H9,0-1[9;1H[?12l[?25h[?25l[24;63H10,1 [10;1H[?12l[?25h[?25l[24;64H1,0-1[11;1H[?12l[?25h[?25l[24;64H2,1 [12;1H[?12l[?25h[?25l[24;64H3,0-1[13;1H[?12l[?25h[?25l[24;64H4,1 [14;1H[?12l[?25h[?25l[24;64H5,0-1[15;1H[?12l[?25h[?25l[24;64H6,1 [16;1H[?12l[?25h[?25l[24;64H7[17;1H[?12l[?25h[?25l[24;64H8[18;1H[?12l[?25h[?25l[24;64H9[19;1H[?12l[?25h[?25l[24;63H20[20;1H[?12l[?25h[?25l[24;64H1[21;1H[?12l[?25h[?25l[24;64H2[22;1H[?12l[?25h[?25l[24;64H3[23;1H[?12l[?25h[?25l[1;23r[23;1H
9944[1;24r[24;63H[K[24;63H24,0-1[8C33%[23;1H[?12l[?25h[?25l[1;23r[23;1H
9945[1;24r[23;1H[34m# Members of the admin group may gain root privileges[m[24;63H[K[24;63H25,1[10C66%[23;1H[?12l[?25h[?25l[1;23r[23;1H
9946[1;24r[23;1H[35m%admin[m [35mALL[m[38;5;130m=[m[35m(ALL)[m [35mALL[m[24;63H[K[24;63H26,1[10CBot[23;1H[?12l[?25h[?25l[24;63H[K[24;1H:[?12l[?25hq[?25l[?12l[?25h
9947[?25l[24;1H[K[24;1H[?1l>[?12l[?25h[?1049l]0;netfpga@node1-1: ~netfpga@node1-1:~$ sudo vi /etc/sudoers
9948[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Kvi[K[Ksudo visudo
9949[?1049h[1;24r[4l[m(B[37m[40m[1;24r[H[2J[24;1H[33m[41mloading /usr/share/jed/lib/site.slc[24;28Hmini[24;36H[24;28Hos.sl[37m[40m[K[24;28H[33m[41mmenus.slc[24;28Hdefaults.sl[24;10Hetc/jed.d/05jed-common.sl[37m[40m[K[24;10H[33m[41musr/share/jed/lib/emacs.slc[24;28Hcolors/black3.slc[1m[37m[40m[1;24r[H[2J[24;1H[33mReading[37m [33m/etc/sudoers.tmp
9950lo[7Cusr/share/jed/lib/textmode.slc[24;28Hmodeinfo[24;40H[1;1H[m(B[37m[44mF10 key ==> [1m[33m[44mF[m(B[37m[44mile [1m[33m[44mE[m(B[37m[44mdit [1m[33m[44mS[m(B[37m[44mearch [1m[33m[44mB[m(B[37m[44muffers W[1m[33m[44mi[m(B[37m[44mndows S[1m[33m[44my[m(B[37m[44mstem [1m[33m[44mH[m(B[37m[44melp[K
9951[1m[37m[40m# /etc/sudoers
9952#
9953# This file MUST be edited with the 'visudo' command as root.
9954#
9955# See the man page for details on how to write a sudoers file.
9956#
9957
9958Defaults[8Cenv_reset
9959
9960# Host alias specification
9961
9962# User alias specification
9963
9964# Cmnd alias specification
9965
9966# User privilege specification
9967root ALL=(ALL) ALL
9968openflow ALL=(ALL) NOPASSWD:ALL
9969netfpga ALL=(ALL) NOPASSWD:ALL
9970# Uncomment to allow members of group sudo to not need a password
9971# (Note that later entries override this, so you might need to move
9972[33m[44m-------+(Jed 0.99.18U) Emacs: sudoers.tmp (Text) Top 5:33pm---------------[2;1H[24;1H[37m[40m[K[3;1H
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989[A[19;1H[19;2H[19;3H[19;4H[19;5H[19;6H[19;7H[19;8H[19;9H[19;10H[19;11H[19;12H[19;13H[19;14H[19;15H[19;16H[19;17H[19;18H[19;19H[19;20H[19;21H[19;22H[19;23H[19;24H[19;25H[19;26H[19;27H[19;28H[19;29H[19;30H[19;31H[19;32H[23;2H[33m[44m**[19;33H[37m[40mSETENV:ALL[20;31H[20;32H[20;33HSEETE[K[K[KTEMV[K[KNVL[K:ALL
9990
9991
9992
9993[33mloading[37m [33m/usr/share/jed/lib/popups.slc[1;13H[46mF[37mile[23;63H[33m[44m4[1;13H[2;13H[m(B[37m[44m┌────────────────────────┐[3;13H│[1m[37m[46m [33mO[37mpen ^X^F[m(B[37m[44m│[4;13H│ [1m[33m[44mC[m(B[37m[44mlose │[34m[40mi[5;13H[37m[44m│ [1m[33m[44mS[m(B[37m[44mave ^X^S│[6;13H│ Save [1m[33m[44mA[m(B[37m[44ms ^X^W│[34m[40mt[7;13H[37m[44m│ Save [1m[33m[44mB[m(B[37m[44muffers ^XS │[8;13H│ [1m[33m[44mI[m(B[37m[44mnsert File ^XI │[9;13H│ ────────────────────── │[10;13H│ Canc[1m[33m[44me[m(B[37m[44ml Operation ^G │[11;13H│ E[1m[33m[44mx[m(B[37m[44mit ^X^C│[12;13H└────────────────────────┘[13;14H[34m[40mspecification[24;1H[1m[37m[40m[K[3;37H[3;14H[m(B[37m[44m [1m[33m[44mO[m(B[37m[44mpen ^X^F[4;14H[1m[37m[46m [33mC[37mlose [4;14H[m(B[37m[44m [1m[33m[44mC[m(B[37m[44mlose [5;14H[1m[37m[46m [33mS[37mave ^X^S[1;13H[33m[44mF[m(B[37m[44mile[2;13H[1m[37m[40mrs[K[3;13H[K[4;13HMUST be edited with the 'vi[5;13H[K[6;13Hn page for details on how t[7;13H[K[8;13H[K[9;13H env_reset[K[10;13H[K[11;13H specification[K[12;13H[K[13;14Hspecification[K[23;2H[33m[44m--
9994[40mWrote[37m [33m26[37m [33mlines[37m [33mto[37m [33m/etc/sudoers.tmp[20;42H[1;13H[46mF[37mile[24;1H[40m[K[1;13H[2;13H[m(B[37m[44m┌────────────────────────┐[3;13H│[1m[37m[46m [33mO[37mpen ^X^F[m(B[37m[44m│[4;13H│ [1m[33m[44mC[m(B[37m[44mlose │[34m[40mi[5;13H[37m[44m│ [1m[33m[44mS[m(B[37m[44mave ^X^S│[6;13H│ Save [1m[33m[44mA[m(B[37m[44ms ^X^W│[34m[40mt[7;13H[37m[44m│ Save [1m[33m[44mB[m(B[37m[44muffers ^XS │[8;13H│ [1m[33m[44mI[m(B[37m[44mnsert File ^XI │[9;13H│ ────────────────────── │[10;13H│ Canc[1m[33m[44me[m(B[37m[44ml Operation ^G │[11;13H│ E[1m[33m[44mx[m(B[37m[44mit ^X^C│[12;13H└────────────────────────┘[13;14H[34m[40mspecification[3;37H[3;14H[37m[44m [1m[33m[44mO[m(B[37m[44mpen ^X^F[11;14H[1m[37m[46m E[33mx[37mit ^X^C[24;1H[40m[m(B[39;49m
9995[K
9996[?1049l>>> /etc/sudoers: syntax error near line 17 <<<
9997>>> /etc/sudoers: syntax error near line 18 <<<
9998What now?
9999Options are:
10000 (e)dit sudoers file again
10001 e(x)it without saving changes to sudoers file
10002 (Q)uit and save changes to sudoers file (DANGER!)
10003
10004What now? e
10005[?1049h[1;24r[4l[m(B[37m[40m[1;24r[H[2J[24;1H[33m[41mloading /usr/share/jed/lib/site.slc[24;28Hmini[24;36H[24;28Hos.sl[37m[40m[K[24;28H[33m[41mmenus.slc[24;28Hdefaults.sl[24;10Hetc/jed.d/05jed-common.sl[37m[40m[K[24;10H[33m[41musr/share/jed/lib/emacs.slc[24;28Hcolors/black3.slc[1m[37m[40m[1;24r[H[2J[24;1H[33mloading[37m [33m/usr/share/jed/lib/textmode.slc[24;28Hmodeinfo[24;40H[1;1H[m(B[37m[44mF10 key ==> [1m[33m[44mF[m(B[37m[44mile [1m[33m[44mE[m(B[37m[44mdit [1m[33m[44mS[m(B[37m[44mearch [1m[33m[44mB[m(B[37m[44muffers W[1m[33m[44mi[m(B[37m[44mndows S[1m[33m[44my[m(B[37m[44mstem [1m[33m[44mH[m(B[37m[44melp[K
10006
10007[1m[37m[40mDefaults[8Cenv_reset
10008
10009# Host alias specification
10010
10011# User alias specification
10012
10013# Cmnd alias specification
10014
10015# User privilege specification
10016root ALL=(ALL) ALL
10017openflow ALL=(ALL) NOPASSWD:ALL SETENV:ALL
10018netfpga ALL=(ALL) NOPASSWD:ALL SETENV:ALL
10019# Uncomment to allow members of group sudo to not need a password
10020# (Note that later entries override this, so you might need to move
10021# it further down)
10022# %sudo ALL=NOPASSWD: ALL
10023
10024# Members of the admin group may gain root privileges
10025%admin ALL=(ALL) ALL
10026
10027[33m[44m-------+(Jed 0.99.18U) Emacs: sudoers.tmp (Text) Bot 5:34pm---------------[12;1H[24;1H[37m[40m[K[13;1H
10028
10029[A[A
10030
10031
10032
10033
10034
10035
10036
10037
10038[24;1H[31mRun-Time[37m [31mError[22;1H[37m[22;1H[22;1H[22;1H[22;1H[22;1H[22;1H[22;1H[22;1H[22;1H[22;1H[22;1H[22;1H
10039
10040[K[21;1H[23;63H[33m[44m5[21;1H[23;63H6[22;1H[37m[40m[24;1H[31mRun-Time[37m [31mError[22;1H
10041
10042[37m[K[21;1H[A[A[A[A[A[A[A[A[A
10043[13;2H[13;3H[13;4H[13;5H[13;6H[13;7H[13;8H[13;9H[13;10H[13;11H[13;12H[13;13H[13;14H[13;15H[13;16H[13;17H[13;18H[13;19H[13;20H[13;21H[13;22H[13;23H[13;24H[13;25H[13;26H[13;27H[13;28H[13;29H[13;30H[13;31H[13;32H[13;33HSETENV:ALL[K[23;2H[33m[44m**[13;32H[37m[40mSETENV:ALL[K[13;31HSETENV:ALL[K[13;30HSETENV:ALL[K[13;29H SETENV:ALL[13;30H[14;30H[14;31H[14;32H[14;33HSETENV:ALL[K[14;31HSETENV:ALL[K[14;30HSETENV:ALL[K[14;29HSETENV:ALL[K[14;28H SETENV:ALL[14;29H[24;1H[33mloading[37m [33m/usr/share/jed/lib/popups.slc[1;13H[46mF[37mile[1;13H[2;13H[m(B[37m[44m┌────────────────────────┐[3;13H│[1m[37m[46m [33mO[37mpen ^X^F[m(B[37m[44m│[4;13H│ [1m[33m[44mC[m(B[37m[44mlose │[5;13H│ [1m[33m[44mS[m(B[37m[44mave ^X^S│[6;13H│ Save [1m[33m[44mA[m(B[37m[44ms ^X^W│[7;13H│ Save [1m[33m[44mB[m(B[37m[44muffers ^XS │[8;13H│ [1m[33m[44mI[m(B[37m[44mnsert File ^XI │[9;13H│ ────────────────────── │[10;13H│ Canc[1m[33m[44me[m(B[37m[44ml Operation ^G │[11;13H│ E[1m[33m[44mx[m(B[37m[44mit ^X^C│[12;13H└────────────────────────┘[13;14H[34m[40m(ALL)[1m[37m[40m [m(B[34m[40mNOPASSWD:[1m[37m[40m [m(B[34m[40mSETENV:ALL[24;1H[1m[37m[40m[K[3;37H[3;14H[m(B[37m[44m [1m[33m[44mO[m(B[37m[44mpen ^X^F[4;14H[1m[37m[46m [33mC[37mlose [4;14H[m(B[37m[44m [1m[33m[44mC[m(B[37m[44mlose [5;14H[1m[37m[46m [33mS[37mave ^X^S[1;13H[33m[44mF[m(B[37m[44mile[2;13H[1m[37m[40m[K[3;13H env_reset[K[4;13H[K[5;13H specification[K[6;13H[K[7;13H specification[K[8;13H[K[9;13H specification[K[10;13H[K[11;13Hlege specification[K[12;13H(ALL) ALL[K[13;14H(ALL) NOPASSWD: SETENV:ALL[23;2H[33m[44m--
10044[40mWrote[37m [33m26[37m [33mlines[37m [33mto[37m [33m/etc/sudoers.tmp[14;29H[1;13H[46mF[37mile[24;1H[40m[K[1;13H[2;13H[m(B[37m[44m┌────────────────────────┐[3;13H│[1m[37m[46m [33mO[37mpen ^X^F[m(B[37m[44m│[4;13H│ [1m[33m[44mC[m(B[37m[44mlose │[5;13H│ [1m[33m[44mS[m(B[37m[44mave ^X^S│[6;13H│ Save [1m[33m[44mA[m(B[37m[44ms ^X^W│[7;13H│ Save [1m[33m[44mB[m(B[37m[44muffers ^XS │[8;13H│ [1m[33m[44mI[m(B[37m[44mnsert File ^XI │[9;13H│ ────────────────────── │[10;13H│ Canc[1m[33m[44me[m(B[37m[44ml Operation ^G │[11;13H│ E[1m[33m[44mx[m(B[37m[44mit ^X^C│[12;13H└────────────────────────┘[13;14H[34m[40m(ALL)[1m[37m[40m [m(B[34m[40mNOPASSWD:[1m[37m[40m [m(B[34m[40mSETENV:ALL[3;37H[3;14H[37m[44m [1m[33m[44mO[m(B[37m[44mpen ^X^F[4;14H[1m[37m[46m [33mC[37mlose [3;14H [33mO[37mpen ^X^F[4;14H[m(B[37m[44m [1m[33m[44mC[m(B[37m[44mlose [3;37H[3;14H [1m[33m[44mO[m(B[37m[44mpen ^X^F[11;14H[1m[37m[46m E[33mx[37mit ^X^C[24;1H[40m[m(B[39;49m
10045[K
10046[?1049l]0;netfpga@node1-1: ~netfpga@node1-1:~$
10047]0;netfpga@node1-1: ~netfpga@node1-1:~$
10048]0;netfpga@node1-1: ~netfpga@node1-1:~$
10049]0;netfpga@node1-1: ~netfpga@node1-1:~$ sudo visudo /etc/sudoers
10050[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[8Pman 5 sudoers[5Psudosudo -E netfpga/bin/nf_regress_test.pl --project driver
10051Can't locate NF/Base.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at netfpga/bin/nf_regress_test.pl line 3.
10052BEGIN failed--compilation aborted at netfpga/bin/nf_regress_test.pl line 3.
10053]0;netfpga@node1-1: ~netfpga@node1-1:~$ sudo -E netfpga/bin/nf_regress_test.pl --project driver
10054[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cvisudo[K
10055[?1049h[1;24r[4l[m(B[37m[40m[1;24r[H[2J[24;1H[33m[41mloading /usr/share/jed/lib/site.slc[24;28Hmini[24;36H[24;28Hos.sl[37m[40m[K[24;28H[33m[41mmenus.slc[24;28Hdefaults.sl[24;10Hetc/jed.d/05jed-common.sl[37m[40m[K[24;10H[33m[41musr/share/jed/lib/emacs.slc[24;28Hcolors/black3.slc[1m[37m[40m[1;24r[H[2J[24;1H[33mReading[37m [33m/etc/sudoers.tmp
10056lo[7Cusr/share/jed/lib/textmode.slc[24;28Hmodeinfo[24;40H[1;1H[m(B[37m[44mF10 key ==> [1m[33m[44mF[m(B[37m[44mile [1m[33m[44mE[m(B[37m[44mdit [1m[33m[44mS[m(B[37m[44mearch [1m[33m[44mB[m(B[37m[44muffers W[1m[33m[44mi[m(B[37m[44mndows S[1m[33m[44my[m(B[37m[44mstem [1m[33m[44mH[m(B[37m[44melp[K
10057[1m[37m[40m# /etc/sudoers
10058#
10059# This file MUST be edited with the 'visudo' command as root.
10060#
10061# See the man page for details on how to write a sudoers file.
10062#
10063
10064Defaults[8Cenv_reset
10065
10066# Host alias specification
10067
10068# User alias specification
10069
10070# Cmnd alias specification
10071
10072# User privilege specification
10073root ALL=(ALL) ALL
10074openflow ALL=(ALL) NOPASSWD: SETENV:ALL
10075netfpga ALL=(ALL) NOPASSWD: SETENV:ALL
10076# Uncomment to allow members of group sudo to not need a password
10077# (Note that later entries override this, so you might need to move
10078[33m[44m-------+(Jed 0.99.18U) Emacs: sudoers.tmp (Text) Top 5:43pm---------------[2;1H[24;1H[37m[40m[K[3;1H
10079
10080
10081
10082
10083
10084iDefaults[7C[23;2H[33m[44m**[9;2H[37m[40m#Defaults[6C[9;3H[9;2HDefaults [6C[9;2H
10085Defaults [7C
100863Defaults[7C[9;2H
10087Defaults [7C
10088#Defaults[7C[9;2H[24;1H[33mloading[37m [33m/usr/share/jed/lib/popups.slc[1;13H[46mF[37mile[1;13H[2;13H[m(B[37m[44m┌────────────────────────┐[3;13H│[1m[37m[46m [33mO[37mpen ^X^F[m(B[37m[44m│[4;13H│ [1m[33m[44mC[m(B[37m[44mlose │[34m[40mi[5;13H[37m[44m│ [1m[33m[44mS[m(B[37m[44mave ^X^S│[6;13H│ Save [1m[33m[44mA[m(B[37m[44ms ^X^W│[34m[40mt[7;13H[37m[44m│ Save [1m[33m[44mB[m(B[37m[44muffers ^XS │[8;13H│ [1m[33m[44mI[m(B[37m[44mnsert File ^XI │[9;13H│ ────────────────────── │[10;13H│ Canc[1m[33m[44me[m(B[37m[44ml Operation ^G │[11;13H│ E[1m[33m[44mx[m(B[37m[44mit ^X^C│[12;13H└────────────────────────┘[13;14H[34m[40mspecification[24;1H[1m[37m[40m[K[3;37H[3;14H[m(B[37m[44m [1m[33m[44mO[m(B[37m[44mpen ^X^F[4;14H[1m[37m[46m [33mC[37mlose [4;14H[m(B[37m[44m [1m[33m[44mC[m(B[37m[44mlose [5;14H[1m[37m[46m [33mS[37mave ^X^S[1;13H[33m[44mF[m(B[37m[44mile[2;13H[1m[37m[40mrs[K[3;13H[K[4;13HMUST be edited with the 'vi[5;13H[K[6;13Hn page for details on how t[7;13H[K[8;13H[K[9;13H env_reset[K[10;13H[K[11;13H specification[K[12;13H[K[13;14Hspecification[K[23;2H[33m[44m--
10089[40mWrote[37m [33m26[37m [33mlines[37m [33mto[37m [33m/etc/sudoers.tmp[9;2H[1;13H[46mF[37mile[24;1H[40m[K[1;13H[2;13H[m(B[37m[44m┌────────────────────────┐[3;13H│[1m[37m[46m [33mO[37mpen ^X^F[m(B[37m[44m│[4;13H│ [1m[33m[44mC[m(B[37m[44mlose │[34m[40mi[5;13H[37m[44m│ [1m[33m[44mS[m(B[37m[44mave ^X^S│[6;13H│ Save [1m[33m[44mA[m(B[37m[44ms ^X^W│[34m[40mt[7;13H[37m[44m│ Save [1m[33m[44mB[m(B[37m[44muffers ^XS │[8;13H│ [1m[33m[44mI[m(B[37m[44mnsert File ^XI │[9;13H│ ────────────────────── │[10;13H│ Canc[1m[33m[44me[m(B[37m[44ml Operation ^G │[11;13H│ E[1m[33m[44mx[m(B[37m[44mit ^X^C│[12;13H└────────────────────────┘[13;14H[34m[40mspecification[3;37H[3;14H[37m[44m [1m[33m[44mO[m(B[37m[44mpen ^X^F[11;14H[1m[37m[46m E[33mx[37mit ^X^C[24;1H[40m[m(B[39;49m
10090[K
10091[?1049l]0;netfpga@node1-1: ~netfpga@node1-1:~$
10092]0;netfpga@node1-1: ~netfpga@node1-1:~$
10093]0;netfpga@node1-1: ~netfpga@node1-1:~$ sudo visudo-E netfpga/bin/nf_regress_test.pl --project driver
10094Can't locate NF/Base.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at netfpga/bin/nf_regress_test.pl line 3.
10095BEGIN failed--compilation aborted at netfpga/bin/nf_regress_test.pl line 3.
10096]0;netfpga@node1-1: ~netfpga@node1-1:~$ sudo -e[KE echo $PERL5LIB
10097/home/netfpga/netfpga/projects/reference_nic/lib/Perl5:/home/netfpga/netfpga/lib/Perl5:
10098]0;netfpga@node1-1: ~netfpga@node1-1:~$ sudo -E echo $PERL5LIB[1P[1P[1P
10099/home/netfpga/netfpga/projects/reference_nic/lib/Perl5:/home/netfpga/netfpga/lib/Perl5:
10100]0;netfpga@node1-1: ~netfpga@node1-1:~$ sudo echo $PERL5LIB[K[K[K[K[K[K[K[K[K$PWD
10101/home/netfpga
10102]0;netfpga@node1-1: ~netfpga@node1-1:~$ sudo echo $PWDERL5LIBWD[K[Ksudo bash
10103]0;root@node1-1: ~root@node1-1:~# echo $PERL5LIB
10104/home/netfpga/netfpga/projects/reference_nic/lib/Perl5:/home/netfpga/netfpga/lib/Perl5:
10105]0;root@node1-1: ~root@node1-1:~# echo NF_ROOT
10106NF_ROOT
10107]0;root@node1-1: ~root@node1-1:~# echo NF_ROOT$NF_ROOT
10108/home/netfpga/netfpga
10109]0;root@node1-1: ~root@node1-1:~# pwd
10110/home/netfpga
10111]0;root@node1-1: ~root@node1-1:~# pwdecho $NF_ROOT[1PNF_ROOT$PERL5LIB[K[K[K[K[K[K[K[K[K[K[K[K[K[Knetf[[Kpga/bin/nf_regf[Kg[Kress_test.pl ==[K[K--proejct [K[K[K[K[Kject driver
10112
10113NetFPGA environment:
10114 Root dir: /home/netfpga/netfpga
10115 Project name: driver
10116 Project dir: /home/netfpga/netfpga/projects/driver
10117 Work dir: /tmp/root
10118
10119Root directory is /home/netfpga/netfpga
10120Running tests on project 'driver'...
10121 Running global setup... PASS
10122 Running test 'driver_compile'... PASS
10123 Running test 'driver_install'... PASS
10124 Running test 'modprobe'... PASS
10125 Running test 'verify_mtu'... PASS
10126 Running test 'verify_4_interfaces'... FAIL
10127Output was:
10128[: 97: Illegal number: !
10129/home/netfpga/netfpga/projects/driver/regress/verify_4_interfaces/run: 97: Syntax error: Bad fd number
10130
10131
10132verify_4_interfaces/run exited with value 2
10133
10134 Running global teardown... PASS
10135
10136
10137]0;root@node1-1: ~root@node1-1:~# ifconfig
10138control Link encap:Ethernet HWaddr 00:15:17:d6:da:4b
10139 inet addr:10.19.1.1 Bcast:10.19.255.255 Mask:255.255.0.0
10140 inet6 addr: fe80::215:17ff:fed6:da4b/64 Scope:Link
10141 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10142 RX packets:25593 errors:0 dropped:0 overruns:0 frame:0
10143 TX packets:15809 errors:0 dropped:0 overruns:0 carrier:0
10144 collisions:0 txqueuelen:1000
10145 RX bytes:2269564 (2.2 MB) TX bytes:2907154 (2.9 MB)
10146 Memory:febe0000-fec00000
10147
10148exp0 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
10149 inet addr:192.168.11.5 Bcast:192.168.255.255 Mask:255.255.0.0
10150 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
10151 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10152 RX packets:17 errors:0 dropped:0 overruns:0 frame:0
10153 TX packets:110 errors:0 dropped:0 overruns:0 carrier:0
10154 collisions:0 txqueuelen:1000
10155 RX bytes:1020 (1.0 KB) TX bytes:18862 (18.8 KB)
10156 Memory:feb80000-feba0000
10157
10158exp0.1 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
10159 inet addr:192.168.11.51 Bcast:192.168.255.255 Mask:255.255.0.0
10160 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
10161 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10162 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
10163 TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
10164 collisions:0 txqueuelen:0
10165 RX bytes:0 (0.0 B) TX bytes:5597 (5.5 KB)
10166
10167exp0.2 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
10168 inet addr:192.168.11.52 Bcast:192.168.255.255 Mask:255.255.0.0
10169 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
10170 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10171 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
10172 TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
10173 collisions:0 txqueuelen:0
10174 RX bytes:0 (0.0 B) TX bytes:3148 (3.1 KB)
10175
10176exp0.3 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
10177 inet addr:192.168.11.53 Bcast:192.168.255.255 Mask:255.255.0.0
10178 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
10179 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10180 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
10181 TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
10182 collisions:0 txqueuelen:0
10183 RX bytes:0 (0.0 B) TX bytes:3063 (3.0 KB)
10184
10185exp0.4 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
10186 inet addr:192.168.11.54 Bcast:192.168.255.255 Mask:255.255.0.0
10187 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
10188 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10189 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
10190 TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
10191 collisions:0 txqueuelen:0
10192 RX bytes:0 (0.0 B) TX bytes:2883 (2.8 KB)
10193
10194lo Link encap:Local Loopback
10195 inet addr:127.0.0.1 Mask:255.0.0.0
10196 inet6 addr: ::1/128 Scope:Host
10197 UP LOOPBACK RUNNING MTU:16436 Metric:1
10198 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
10199 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
10200 collisions:0 txqueuelen:0
10201 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
10202
10203]0;root@node1-1: ~root@node1-1:~# for i in `seq 0 3`; do ifconfig nf2c$i up; done
10204]0;root@node1-1: ~root@node1-1:~# for i in `seq 0 3`; do ifconfig nf2c$i up; done
10205[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cifconfig[K
10206control Link encap:Ethernet HWaddr 00:15:17:d6:da:4b
10207 inet addr:10.19.1.1 Bcast:10.19.255.255 Mask:255.255.0.0
10208 inet6 addr: fe80::215:17ff:fed6:da4b/64 Scope:Link
10209 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10210 RX packets:25614 errors:0 dropped:0 overruns:0 frame:0
10211 TX packets:15826 errors:0 dropped:0 overruns:0 carrier:0
10212 collisions:0 txqueuelen:1000
10213 RX bytes:2271312 (2.2 MB) TX bytes:2912429 (2.9 MB)
10214 Memory:febe0000-fec00000
10215
10216exp0 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
10217 inet addr:192.168.11.5 Bcast:192.168.255.255 Mask:255.255.0.0
10218 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
10219 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10220 RX packets:17 errors:0 dropped:0 overruns:0 frame:0
10221 TX packets:110 errors:0 dropped:0 overruns:0 carrier:0
10222 collisions:0 txqueuelen:1000
10223 RX bytes:1020 (1.0 KB) TX bytes:18862 (18.8 KB)
10224 Memory:feb80000-feba0000
10225
10226exp0.1 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
10227 inet addr:192.168.11.51 Bcast:192.168.255.255 Mask:255.255.0.0
10228 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
10229 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10230 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
10231 TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
10232 collisions:0 txqueuelen:0
10233 RX bytes:0 (0.0 B) TX bytes:5597 (5.5 KB)
10234
10235exp0.2 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
10236 inet addr:192.168.11.52 Bcast:192.168.255.255 Mask:255.255.0.0
10237 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
10238 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10239 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
10240 TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
10241 collisions:0 txqueuelen:0
10242 RX bytes:0 (0.0 B) TX bytes:3148 (3.1 KB)
10243
10244exp0.3 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
10245 inet addr:192.168.11.53 Bcast:192.168.255.255 Mask:255.255.0.0
10246 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
10247 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10248 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
10249 TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
10250 collisions:0 txqueuelen:0
10251 RX bytes:0 (0.0 B) TX bytes:3063 (3.0 KB)
10252
10253exp0.4 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
10254 inet addr:192.168.11.54 Bcast:192.168.255.255 Mask:255.255.0.0
10255 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
10256 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10257 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
10258 TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
10259 collisions:0 txqueuelen:0
10260 RX bytes:0 (0.0 B) TX bytes:2883 (2.8 KB)
10261
10262lo Link encap:Local Loopback
10263 inet addr:127.0.0.1 Mask:255.0.0.0
10264 inet6 addr: ::1/128 Scope:Host
10265 UP LOOPBACK RUNNING MTU:16436 Metric:1
10266 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
10267 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
10268 collisions:0 txqueuelen:0
10269 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
10270
10271nf2c0 Link encap:Ethernet HWaddr 00:4e:46:32:43:00
10272 UP BROADCAST MULTICAST MTU:1500 Metric:1
10273 RX packets:40 errors:0 dropped:0 overruns:0 frame:0
10274 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
10275 collisions:0 txqueuelen:1000
10276 RX bytes:2571 (2.5 KB) TX bytes:0 (0.0 B)
10277 Interrupt:16
10278
10279nf2c1 Link encap:Ethernet HWaddr 00:4e:46:32:43:01
10280 UP BROADCAST MULTICAST MTU:1500 Metric:1
10281 RX packets:40 errors:0 dropped:0 overruns:0 frame:0
10282 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
10283 collisions:0 txqueuelen:1000
10284 RX bytes:2571 (2.5 KB) TX bytes:0 (0.0 B)
10285 Interrupt:16
10286
10287nf2c2 Link encap:Ethernet HWaddr 00:4e:46:32:43:02
10288 UP BROADCAST MULTICAST MTU:1500 Metric:1
10289 RX packets:40 errors:0 dropped:0 overruns:0 frame:0
10290 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
10291 collisions:0 txqueuelen:1000
10292 RX bytes:2571 (2.5 KB) TX bytes:0 (0.0 B)
10293 Interrupt:16
10294
10295nf2c3 Link encap:Ethernet HWaddr 00:4e:46:32:43:03
10296 UP BROADCAST MULTICAST MTU:1500 Metric:1
10297 RX packets:40 errors:0 dropped:0 overruns:0 frame:0
10298 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
10299 collisions:0 txqueuelen:1000
10300 RX bytes:2571 (2.5 KB) TX bytes:0 (0.0 B)
10301 Interrupt:16
10302
10303]0;root@node1-1: ~root@node1-1:~# ifconfigfor i in `seq 0 3`; do ifconfig nf2c$i up; done
10304[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cifconfig[Knetfpga/bin/nf_regress_test.pl --project driver
10305
10306NetFPGA environment:
10307 Root dir: /home/netfpga/netfpga
10308 Project name: driver
10309 Project dir: /home/netfpga/netfpga/projects/driver
10310 Work dir: /tmp/root
10311
10312Root directory is /home/netfpga/netfpga
10313Running tests on project 'driver'...
10314 Running global setup... PASS
10315 Running test 'driver_compile'... PASS
10316 Running test 'driver_install'... PASS
10317 Running test 'modprobe'... PASS
10318 Running test 'verify_mtu'... PASS
10319 Running test 'verify_4_interfaces'... FAIL
10320Output was:
10321[: 97: Illegal number: !
10322/home/netfpga/netfpga/projects/driver/regress/verify_4_interfaces/run: 97: Syntax error: Bad fd number
10323
10324
10325verify_4_interfaces/run exited with value 2
10326
10327 Running global teardown... PASS
10328
10329
10330]0;root@node1-1: ~root@node1-1:~# netfpga/bin/nf_regress_test.pl --project driver
10331[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cifconfig[K
10332control Link encap:Ethernet HWaddr 00:15:17:d6:da:4b
10333 inet addr:10.19.1.1 Bcast:10.19.255.255 Mask:255.255.0.0
10334 inet6 addr: fe80::215:17ff:fed6:da4b/64 Scope:Link
10335 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10336 RX packets:25644 errors:0 dropped:0 overruns:0 frame:0
10337 TX packets:15848 errors:0 dropped:0 overruns:0 carrier:0
10338 collisions:0 txqueuelen:1000
10339 RX bytes:2273676 (2.2 MB) TX bytes:2920589 (2.9 MB)
10340 Memory:febe0000-fec00000
10341
10342exp0 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
10343 inet addr:192.168.11.5 Bcast:192.168.255.255 Mask:255.255.0.0
10344 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
10345 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10346 RX packets:17 errors:0 dropped:0 overruns:0 frame:0
10347 TX packets:110 errors:0 dropped:0 overruns:0 carrier:0
10348 collisions:0 txqueuelen:1000
10349 RX bytes:1020 (1.0 KB) TX bytes:18862 (18.8 KB)
10350 Memory:feb80000-feba0000
10351
10352exp0.1 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
10353 inet addr:192.168.11.51 Bcast:192.168.255.255 Mask:255.255.0.0
10354 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
10355 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10356 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
10357 TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
10358 collisions:0 txqueuelen:0
10359 RX bytes:0 (0.0 B) TX bytes:5597 (5.5 KB)
10360
10361exp0.2 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
10362 inet addr:192.168.11.52 Bcast:192.168.255.255 Mask:255.255.0.0
10363 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
10364 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10365 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
10366 TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
10367 collisions:0 txqueuelen:0
10368 RX bytes:0 (0.0 B) TX bytes:3148 (3.1 KB)
10369
10370exp0.3 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
10371 inet addr:192.168.11.53 Bcast:192.168.255.255 Mask:255.255.0.0
10372 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
10373 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10374 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
10375 TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
10376 collisions:0 txqueuelen:0
10377 RX bytes:0 (0.0 B) TX bytes:3063 (3.0 KB)
10378
10379exp0.4 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
10380 inet addr:192.168.11.54 Bcast:192.168.255.255 Mask:255.255.0.0
10381 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
10382 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10383 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
10384 TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
10385 collisions:0 txqueuelen:0
10386 RX bytes:0 (0.0 B) TX bytes:2883 (2.8 KB)
10387
10388lo Link encap:Local Loopback
10389 inet addr:127.0.0.1 Mask:255.0.0.0
10390 inet6 addr: ::1/128 Scope:Host
10391 UP LOOPBACK RUNNING MTU:16436 Metric:1
10392 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
10393 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
10394 collisions:0 txqueuelen:0
10395 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
10396
10397]0;root@node1-1: ~root@node1-1:~# ifconfignetfpga/bin/nf_regress_test.pl --project driver
10398[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cifconfig[Knetfpga/bin/nf_regress_test.pl --project driver
10399[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cifconfig[Kfor i in `seq 0 3`; do ifconfig nf2c$i up; done
10400]0;root@node1-1: ~root@node1-1:~#
10401]0;root@node1-1: ~root@node1-1:~#
10402]0;root@node1-1: ~root@node1-1:~# for i in `seq 0 3`; do ifconfig nf2c$i up; done
10403[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cifconfig[Knetfpga/bin/nf_regress_test.pl --project driver[K[K[K[K[K[K[K 'reference_nic'
10404
10405NetFPGA environment:
10406 Root dir: /home/netfpga/netfpga
10407 Project name: reference_nic
10408 Project dir: /home/netfpga/netfpga/projects/reference_nic
10409 Work dir: /tmp/root
10410
10411Root directory is /home/netfpga/netfpga
10412Running tests on project 'reference_nic'...
10413 Running global setup... FAIL
10414Output was:
10415
10416NetFPGA environment:
10417 Root dir: /home/netfpga/netfpga
10418 Project name: reference_nic
10419 Project dir: /home/netfpga/netfpga/projects/reference_nic
10420 Work dir: /tmp/root
10421
10422Found net device: nf2c0
10423Virtex design compiled against active CPCI version
10424Bit file built from: nf2_top_par.ncd;HW_TIMEOUT=FALSE
10425Part: 2vp50ff1152
10426Date: 2011/ 1/20
10427Time: 4:14:34
10428Error Registers: 0
10429Good, after resetting programming interface the FIFO is empty
10430Download completed - 2377668 bytes. (expected 2377668).
10431DONE went high - chip has been successfully programmed.
10432CPCI Information
10433----------------
10434Version: 4 (rev 1)
10435
10436Device (Virtex) Information
10437---------------------------
10438Project directory: reference_nic
10439Project name: Reference NIC
10440Project description: Reference NIC
10441
10442Device ID: 1
10443Version: 1.1.0
10444Built against CPCI version: 4 (rev 1)
10445
10446SIOCSIFADDR: No such device
10447eth2: ERROR while getting interface flags: No such device
10448SIOCSIFNETMASK: No such device
10449eth2: error fetching interface information: Device not found
10450SIOCSIFADDR: No such device
10451eth1: ERROR while getting interface flags: No such device
10452SIOCSIFNETMASK: No such device
10453eth1: error fetching interface information: Device not found
10454FAIL
10455
10456
10457global/setup exited with value 1
10458
10459
10460
10461]0;root@node1-1: ~root@node1-1:~# exit
10462exit
10463]0;netfpga@node1-1: ~netfpga@node1-1:~$ vi sudo bashecho $PWDERL5LIB[3@-E [C[C[C[C[C[C[C[C[C[C[C[C[C[Cnetfpga/bin/nf_regress_test.pl --project driver
10464[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cecho $PERL5LIB[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[K[Knet[K[K[Kvi netfpga/bin/
10465make_perl_cpan.pl nf_make_alpha_release.pl nf_regress_test.pl
10466match_duplicate_pkts.pl nf_make_release.pl nf_run_test.pl
10467nf_compare.pl nf_profile nf_upgrade_files.pl
10468nf_const_subst.pl nf_profile_stanford
10469nf_cshrc nf_register_gen.pl
10470]0;netfpga@node1-1: ~netfpga@node1-1:~$ vi netfpga/bin/nf_profile
10471[?1049h[?1h=[1;24r[?12;25h[?12l[?25h[27m[m[H[2J[?25l[24;1H"netfpga/bin/nf_profile" 23L, 831C[>c[1;1H[34m# To use the tools for the NetFPGA2 project, you should source this file.
10472# Add the following to your ~/.bashrc file AFTER you set the NF_ROOT variable.
10473# source ${NF_ROOT}/bin/nf2_rc
10474
10475# We really need NF_ROOT to be set....[m
10476if [ [31m"$NF_ROOT"[m = [31m""[m ] ; then
10477 echo [31m"ERROR: the variable NF_ROOT is not set."[m
10478 echo [31m" Please set the variable NF_ROOT to the root directory of your"[m
10479 echo [31m" NetFPGA installation and then re-run this script."[m
10480 echo [31m"\n For example: export NF_ROOT /usr/share/netfpga"[m
10481
10482 exit 1
10483fi
10484
10485[34m# Project scripts, etc.[m
10486export PATH=[31m"${NF_ROOT}/bin:${PATH}"[m
10487
10488
10489[34m# Many of the NetFPGA scripts are Perl scripts, and need certain Perl libraries.[20;1H# So here we set up the Perl 5 library variable to include our libraries.[m
10490export PERL5LIB=[31m"${NF_DESIGN_DIR}/lib/Perl5:${NF_ROOT}/lib/Perl5:${PERL5LIB}"[m[24;63H1,1[11CAll[1;1H[?12l[?25hP+q436f\P+q6b75\P+q6b64\P+q6b72\P+q6b6c\P+q2332\P+q2334\P+q2569\P+q2a37\P+q6b31\P+q6b32\[27m[m[H[2J[?25l[1;1H[34m# To use the tools for the NetFPGA2 project, you should source this file.
10491# Add the following to your ~/.bashrc file AFTER you set the NF_ROOT variable.
10492# source ${NF_ROOT}/bin/nf2_rc
10493
10494# We really need NF_ROOT to be set....[m
10495if [ [31m"$NF_ROOT"[m = [31m""[m ] ; then
10496 echo [31m"ERROR: the variable NF_ROOT is not set."[m
10497 echo [31m" Please set the variable NF_ROOT to the root directory of your"[m
10498 echo [31m" NetFPGA installation and then re-run this script."[m
10499 echo [31m"\n For example: export NF_ROOT /usr/share/netfpga"[m
10500
10501 exit 1
10502fi
10503
10504[34m# Project scripts, etc.[m
10505export PATH=[31m"${NF_ROOT}/bin:${PATH}"[m
10506
10507
10508[34m# Many of the NetFPGA scripts are Perl scripts, and need certain Perl libraries.[20;1H# So here we set up the Perl 5 library variable to include our libraries.[m
10509export PERL5LIB=[31m"${NF_DESIGN_DIR}/lib/Perl5:${NF_ROOT}/lib/Perl5:${PERL5LIB}"[m[24;63H1,1[11CAll
10510"netfpga/bin/nf_profile" 23L, 831C[24;63H[K[24;63H1,1[11CAll[1;1H[?12l[?25hP+q6b33\[?25l[?12l[?25hP+q6b34\P+q6b35\P+q6b36\P+q6b37\P+q6b38\P+q6b39\P+q6b3b\P+q4631\P+q4632\P+q2531\P+q2638\P+q6b62\P+q6b49\P+q6b44\P+q6b68\P+q4037\P+q6b50\P+q6b4e\P+q4b31\P+q4b33\P+q4b34\P+q4b35\P+q6b42\[?25l[24;63H2[2;1H[?12l[?25h[?25l[24;63H3[3;1H[?12l[?25h[?25l[24;63H4,0-1[4;1H[?12l[?25h[?25l[24;63H5,1 [5;1H[?12l[?25h[?25l[24;63H6[6;1H[?12l[?25h[?25l[24;63H7[7;1H[?12l[?25h[?25l[24;63H8[8;1H[?12l[?25h[?25l[24;63H9[9;1H[?12l[?25h[?25l[24;63H10,1[10;1H[?12l[?25h[?25l[24;64H1,0-1[11;1H[?12l[?25h[?25l[24;64H2,1 [12;1H[?12l[?25h[?25l[24;64H3[13;1H[?12l[?25h[?25l[24;64H4,0-1[14;1H[?12l[?25h[?25l[24;64H5,1 [15;1H[?12l[?25h[?25l[24;64H6[16;1H[?12l[?25h[?25l[24;64H7,0-1[17;1H[?12l[?25h[?25l[24;64H8[18;1H[?12l[?25h[?25l[24;64H9,1 [19;1H[?12l[?25h[?25l[24;63H20[20;1H[?12l[?25h[?25l[24;64H1[21;1H[?12l[?25h[?25l[24;64H2,0-1[22;1H[?12l[?25h[?25l[24;64H3[23;1H[?12l[?25h[?25l[24;64H2[22;1H[?12l[?25h[?25l[24;64H1,1 [21;1H[?12l[?25h[?25l[24;1H[K[24;1H:[?12l[?25hq[?25l[?12l[?25h
10511[?25l[24;1H[K[24;1H[?1l>[?12l[?25h[?1049l]0;netfpga@node1-1: ~netfpga@node1-1:~$ vi netfpga/bin/nf_profile[K[K[K[K[K[K[K[K[K[K[K[K[K[K
10512bashrc_addon CHANGES .gitignore Makefile
10513bin/ doc/ lib/ projects/
10514bitfiles/ .git/ LICENSE README
10515]0;netfpga@node1-1: ~netfpga@node1-1:~$ vi netfpga/[K[K[K[K[K[K[K[K[K[K[Kcd netfpga/
10516]0;netfpga@node1-1: ~/netfpganetfpga@node1-1:~/netfpga$ grep eth4 *[1@-[1@r[1@
10517]0;netfpga@node1-1: ~/netfpganetfpga@node1-1:~/netfpga$ ifconfig
10518Command 'ifconfig' is available in '/sbin/ifconfig'
10519The command could not be located because '/sbin' is not included in the PATH environment variable.
10520This is most likely caused by the lack of administrative priviledges associated with your user account.
10521ifconfig: command not found
10522]0;netfpga@node1-1: ~/netfpganetfpga@node1-1:~/netfpga$ sudo ifconfig
10523control Link encap:Ethernet HWaddr 00:15:17:d6:da:4b
10524 inet addr:10.19.1.1 Bcast:10.19.255.255 Mask:255.255.0.0
10525 inet6 addr: fe80::215:17ff:fed6:da4b/64 Scope:Link
10526 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10527 RX packets:26161 errors:0 dropped:0 overruns:0 frame:0
10528 TX packets:16139 errors:0 dropped:0 overruns:0 carrier:0
10529 collisions:0 txqueuelen:1000
10530 RX bytes:2321353 (2.3 MB) TX bytes:2962369 (2.9 MB)
10531 Memory:febe0000-fec00000
10532
10533exp0 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
10534 inet addr:192.168.11.5 Bcast:192.168.255.255 Mask:255.255.0.0
10535 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
10536 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10537 RX packets:18 errors:0 dropped:0 overruns:0 frame:0
10538 TX packets:110 errors:0 dropped:0 overruns:0 carrier:0
10539 collisions:0 txqueuelen:1000
10540 RX bytes:1201 (1.2 KB) TX bytes:18862 (18.8 KB)
10541 Memory:feb80000-feba0000
10542
10543exp0.1 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
10544 inet addr:192.168.11.51 Bcast:192.168.255.255 Mask:255.255.0.0
10545 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
10546 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10547 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
10548 TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
10549 collisions:0 txqueuelen:0
10550 RX bytes:0 (0.0 B) TX bytes:5597 (5.5 KB)
10551
10552exp0.2 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
10553 inet addr:192.168.11.52 Bcast:192.168.255.255 Mask:255.255.0.0
10554 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
10555 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10556 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
10557 TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
10558 collisions:0 txqueuelen:0
10559 RX bytes:0 (0.0 B) TX bytes:3148 (3.1 KB)
10560
10561exp0.3 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
10562 inet addr:192.168.11.53 Bcast:192.168.255.255 Mask:255.255.0.0
10563 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
10564 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10565 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
10566 TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
10567 collisions:0 txqueuelen:0
10568 RX bytes:0 (0.0 B) TX bytes:3063 (3.0 KB)
10569
10570exp0.4 Link encap:Ethernet HWaddr 00:15:17:d6:da:4a
10571 inet addr:192.168.11.54 Bcast:192.168.255.255 Mask:255.255.0.0
10572 inet6 addr: fe80::215:17ff:fed6:da4a/64 Scope:Link
10573 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10574 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
10575 TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
10576 collisions:0 txqueuelen:0
10577 RX bytes:0 (0.0 B) TX bytes:2883 (2.8 KB)
10578
10579lo Link encap:Local Loopback
10580 inet addr:127.0.0.1 Mask:255.0.0.0
10581 inet6 addr: ::1/128 Scope:Host
10582 UP LOOPBACK RUNNING MTU:16436 Metric:1
10583 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
10584 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
10585 collisions:0 txqueuelen:0
10586 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
10587
10588nf2c0 Link encap:Ethernet HWaddr 00:4e:46:32:43:00
10589 inet addr:192.168.200.1 Bcast:192.168.200.3 Mask:255.255.255.252
10590 inet6 addr: fe80::24e:46ff:fe32:4300/64 Scope:Link
10591 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
10592 RX packets:84 errors:0 dropped:0 overruns:0 frame:0
10593 TX packets:16 errors:0 dropped:0 overruns:0 carrier:0