| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Term::Bash::Completion::Generator ; |
|
3
|
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
92680
|
use strict; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
63
|
|
|
5
|
2
|
|
|
2
|
|
11
|
use warnings ; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
55
|
|
|
6
|
2
|
|
|
2
|
|
10
|
use Carp qw(carp croak confess) ; |
|
|
2
|
|
|
|
|
16
|
|
|
|
2
|
|
|
|
|
167
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
BEGIN |
|
9
|
|
|
|
|
|
|
{ |
|
10
|
2
|
|
|
|
|
23
|
use Sub::Exporter -setup => |
|
11
|
|
|
|
|
|
|
{ |
|
12
|
|
|
|
|
|
|
exports => [ qw() ], |
|
13
|
|
|
|
|
|
|
groups => |
|
14
|
|
|
|
|
|
|
{ |
|
15
|
|
|
|
|
|
|
all => [ qw() ], |
|
16
|
|
|
|
|
|
|
} |
|
17
|
2
|
|
|
2
|
|
2347
|
}; |
|
|
2
|
|
|
|
|
45369
|
|
|
18
|
|
|
|
|
|
|
|
|
19
|
2
|
|
|
2
|
|
797
|
use vars qw ($VERSION); |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
93
|
|
|
20
|
2
|
|
|
2
|
|
2048
|
$VERSION = '0.02'; |
|
21
|
|
|
|
|
|
|
} |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 NAME |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Term::Bash::Completion::Generator - Generate bash completion scripts |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# use default bash completion options |
|
32
|
|
|
|
|
|
|
generate_bash_completion_function('my_command', ['option1', ''option2']) ; |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# fine tune with the bash completion options |
|
35
|
|
|
|
|
|
|
generate_bash_completion_function('my_command', ['option1', ''option2'], '-*', 0, '-o plusdirs') |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Generate bash completion functions or perl scripts to dynamically provide completion for an application. |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 DOCUMENTATION |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
If you application or scripts have more than one or two options and you run a bash shell, it is |
|
44
|
|
|
|
|
|
|
advisable you provide a completion file for your application. |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
A completion file provides information to bash so when your user presses [tab], on the command line, |
|
47
|
|
|
|
|
|
|
possible completion is provided to the user. |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
This module provide you with subroutines to create the completion scripts. The completion scripts are |
|
50
|
|
|
|
|
|
|
either simple bash functions or scripts that allow you to dynamically generate completion. The scripts |
|
51
|
|
|
|
|
|
|
can be written in any language. This module generate scripts that are written in perl. |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
The perl scripts can be generated by calling the subroutine i this module or by running |
|
54
|
|
|
|
|
|
|
the I script installed with this module. |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
The generated scripts can provide completion for applications written in any language. A good place to |
|
57
|
|
|
|
|
|
|
generate completion is in your I or I. Remember to test your completions too. |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 BASH COMPLETION DOCUMENTATION |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Run 'man bash' on your prompt and search for 'Programmable Completion'. |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
bash-completion-20060301.tar.gz library, an older but useful archive of completion functions for common |
|
64
|
|
|
|
|
|
|
commands. |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=cut |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
#~ sub generate_bash_completion_function_using_perl_script |
|
74
|
|
|
|
|
|
|
#~ { |
|
75
|
|
|
|
|
|
|
#~ # generate a bash function that calls a perl script |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
#~ #check if one can get the whole command line to the perl script |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
#~ } |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub generate_perl_completion_script |
|
84
|
|
|
|
|
|
|
{ |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head2 generate_perl_completion_script($command, \@completion_list) |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Generates a perl script that can be used to dynamically generate completion for the bash |
|
89
|
|
|
|
|
|
|
command line. |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
L is used in the script to do the basic look-up. L was installed as |
|
92
|
|
|
|
|
|
|
dependency to this module. Modify the generated script to implement your completion logic. |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
You can also use the I script to create the perl completion |
|
95
|
|
|
|
|
|
|
script from the command line. |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
I |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=over 2 |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=item * $command - a string containing the command name |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=item * \@completion_list - list of options to create completion for |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
the options can be simple strings or a L specifications |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=back |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
I - an array containing: |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=over 2 |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=item * a string containing the bash completion command |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=item * a string containing the perl script |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=back |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
I - carps if $command is not defined |
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=cut |
|
122
|
|
|
|
|
|
|
|
|
123
|
3
|
|
|
3
|
1
|
2611
|
my ($command, $completion_list) = @_ ; |
|
124
|
|
|
|
|
|
|
|
|
125
|
3
|
100
|
|
|
|
29
|
croak 'Argument "$command" not defined' unless defined $command ; ## no critic ValuesAndExpressions::RequireInterpolationOfMetachars |
|
126
|
|
|
|
|
|
|
|
|
127
|
2
|
|
|
|
|
6
|
my $bash_completion_arguments = "-o default -C perl_completion_script $command" ; |
|
128
|
2
|
|
|
|
|
5
|
my $bash_completion_command = "complete $bash_completion_arguments" ; |
|
129
|
|
|
|
|
|
|
|
|
130
|
2
|
|
|
|
|
4
|
my $perl_completion_script = <<'EOC' ; |
|
131
|
|
|
|
|
|
|
#! /usr/bin/perl |
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=pod |
|
134
|
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
B the following line in your I<~/.bashrc>: |
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
EOC |
|
138
|
|
|
|
|
|
|
|
|
139
|
2
|
|
|
|
|
5
|
$perl_completion_script .= <<"EOC" ; |
|
140
|
|
|
|
|
|
|
B $bash_completion_arguments |
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
EOC |
|
143
|
|
|
|
|
|
|
|
|
144
|
2
|
|
|
|
|
5
|
$perl_completion_script .= <<'EOC' ; |
|
145
|
|
|
|
|
|
|
Replace I with the name you saved the script under. The script has to |
|
146
|
|
|
|
|
|
|
be executable and somewhere in the path. |
|
147
|
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
The script will receive these arguments from bash: |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
@ARGV |
|
151
|
|
|
|
|
|
|
|- 0 = command |
|
152
|
|
|
|
|
|
|
|- 1 = word_to_complete |
|
153
|
|
|
|
|
|
|
`- 2 = word_before_the_word_to_complete |
|
154
|
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
You return possible completion you want separated by I<\n>. Return nothing if you |
|
156
|
|
|
|
|
|
|
want the default bash completion to be run which is possible because of the <-o defaul> |
|
157
|
|
|
|
|
|
|
passed to the B command. |
|
158
|
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
Note! You may have to re-run the B command after you modify your perl script. |
|
160
|
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=cut |
|
162
|
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
use strict; |
|
164
|
|
|
|
|
|
|
use Tree::Trie; |
|
165
|
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
my @completions = |
|
167
|
|
|
|
|
|
|
qw( |
|
168
|
|
|
|
|
|
|
EOC |
|
169
|
|
|
|
|
|
|
|
|
170
|
2
|
100
|
|
|
|
6
|
if(defined $completion_list) |
|
171
|
|
|
|
|
|
|
{ |
|
172
|
1
|
|
|
|
|
4
|
$completion_list = de_getop_ify_list($completion_list) ; |
|
173
|
|
|
|
|
|
|
} |
|
174
|
|
|
|
|
|
|
else |
|
175
|
|
|
|
|
|
|
{ |
|
176
|
1
|
|
|
|
|
6
|
$completion_list = [qw(aeode calliope clio erato euterpe melete melpomene mneme polymnia terpsichore thalia urania)] |
|
177
|
|
|
|
|
|
|
} |
|
178
|
|
|
|
|
|
|
|
|
179
|
2
|
|
|
|
|
4
|
for my $option (@{$completion_list}) |
|
|
2
|
|
|
|
|
9
|
|
|
180
|
|
|
|
|
|
|
{ |
|
181
|
17
|
100
|
|
|
|
185
|
if(1 == length($option)) |
|
182
|
|
|
|
|
|
|
{ |
|
183
|
3
|
|
|
|
|
7
|
$perl_completion_script .= "\t-$option\n" ; |
|
184
|
|
|
|
|
|
|
} |
|
185
|
|
|
|
|
|
|
else |
|
186
|
|
|
|
|
|
|
{ |
|
187
|
14
|
|
|
|
|
34
|
$perl_completion_script .= "\t--$option\n" ; |
|
188
|
|
|
|
|
|
|
} |
|
189
|
|
|
|
|
|
|
} |
|
190
|
|
|
|
|
|
|
|
|
191
|
2
|
|
|
|
|
6
|
$perl_completion_script .= <<'EOC' ; |
|
192
|
|
|
|
|
|
|
) ; |
|
193
|
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
my($trie) = new Tree::Trie; |
|
195
|
|
|
|
|
|
|
$trie->add(@completions) ; |
|
196
|
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
if(defined $ARGV[1]) |
|
198
|
|
|
|
|
|
|
{ |
|
199
|
|
|
|
|
|
|
if(substr($ARGV[1], 0, 1) eq '-') |
|
200
|
|
|
|
|
|
|
{ |
|
201
|
|
|
|
|
|
|
print join("\n", $trie->lookup($ARGV[1])) ; |
|
202
|
|
|
|
|
|
|
} |
|
203
|
|
|
|
|
|
|
} |
|
204
|
|
|
|
|
|
|
else |
|
205
|
|
|
|
|
|
|
{ |
|
206
|
|
|
|
|
|
|
print join("\n", $trie->lookup('')) ; |
|
207
|
|
|
|
|
|
|
} |
|
208
|
|
|
|
|
|
|
EOC |
|
209
|
|
|
|
|
|
|
|
|
210
|
2
|
|
|
|
|
11
|
return($bash_completion_command, $perl_completion_script) ; |
|
211
|
|
|
|
|
|
|
} |
|
212
|
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
sub generate_bash_completion_function |
|
214
|
|
|
|
|
|
|
{ |
|
215
|
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
=head2 generate_bash_completion_function($command, \@completion_list, $completion_prefix, $single_and_double_dash, $complete_options) |
|
217
|
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
Generates a bash function that provides completion for the options passed as parameter. |
|
219
|
|
|
|
|
|
|
The options can be simple strings like 'output_directory' or 'a' or L specifications |
|
220
|
|
|
|
|
|
|
like 'j|jobs=i', 'd|display_documentation:s', or 'o'. |
|
221
|
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
Note that the options do not have any dash at the start. |
|
223
|
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
I |
|
225
|
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
=over 2 |
|
227
|
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
=item * $command - a string containing the command name |
|
229
|
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
=item * \@completion_list - list of options to create completion for |
|
231
|
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
the options can be simple strings or a L specifications |
|
233
|
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
=item * $completion_prefix - see bash manual ; default is '-*' |
|
235
|
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
=item * $single_and_double_dash - boolean variable ; default is 1 |
|
237
|
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
0 - single dash for single letter options, double dash for multiple letters options |
|
239
|
|
|
|
|
|
|
1 - all options have single and double dash |
|
240
|
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
=item * $complete_options - string containing the options passed to I ; default is '-o default' |
|
242
|
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
=back |
|
244
|
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
I - a string containing the bash completion script |
|
246
|
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
I - carps if $command is not defined |
|
248
|
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
=cut |
|
250
|
|
|
|
|
|
|
|
|
251
|
4
|
|
|
4
|
1
|
1911
|
my ($command, $completion_list, $completion_prefix, $single_and_double_dash, $complete_options) = @_ ; |
|
252
|
|
|
|
|
|
|
|
|
253
|
4
|
100
|
|
|
|
19
|
croak 'Argument "$command" not defined' unless defined $command ; ## no critic ValuesAndExpressions::RequireInterpolationOfMetachars |
|
254
|
|
|
|
|
|
|
|
|
255
|
3
|
100
|
|
|
|
8
|
$completion_prefix = q{-*} unless defined $completion_prefix ; |
|
256
|
3
|
100
|
|
|
|
7
|
$single_and_double_dash = 1 unless defined $single_and_double_dash ; |
|
257
|
3
|
100
|
|
|
|
6
|
$complete_options = '-o default' unless defined $complete_options ; |
|
258
|
|
|
|
|
|
|
|
|
259
|
3
|
|
|
|
|
6
|
my $completion_function_name = "_${command}_bash_completion" ; |
|
260
|
3
|
|
|
|
|
7
|
$completion_function_name =~ s/[^a-zA-Z0-9_]/_/gsmx ; |
|
261
|
|
|
|
|
|
|
|
|
262
|
3
|
|
|
|
|
12
|
my $completion_function = "$completion_function_name()\n" ; |
|
263
|
|
|
|
|
|
|
|
|
264
|
3
|
|
|
|
|
6
|
$completion_function .= <<'EOH' ; |
|
265
|
|
|
|
|
|
|
{ |
|
266
|
|
|
|
|
|
|
local cur |
|
267
|
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
COMPREPLY=() |
|
269
|
|
|
|
|
|
|
cur=${COMP_WORDS[COMP_CWORD]} |
|
270
|
|
|
|
|
|
|
EOH |
|
271
|
|
|
|
|
|
|
|
|
272
|
3
|
|
|
|
|
7
|
$completion_function .= <<"EOH" ; |
|
273
|
|
|
|
|
|
|
if [[ "\$cur" == $completion_prefix ]]; then |
|
274
|
|
|
|
|
|
|
EOH |
|
275
|
|
|
|
|
|
|
|
|
276
|
3
|
|
|
|
|
7
|
$completion_function .= <<'EOH' ; |
|
277
|
|
|
|
|
|
|
COMPREPLY=( $( compgen -W '\ |
|
278
|
|
|
|
|
|
|
EOH |
|
279
|
|
|
|
|
|
|
|
|
280
|
3
|
|
|
|
|
5
|
$completion_list = de_getop_ify_list($completion_list) ; |
|
281
|
|
|
|
|
|
|
|
|
282
|
3
|
|
|
|
|
4
|
for my $option (@{$completion_list}) |
|
|
3
|
|
|
|
|
25
|
|
|
283
|
|
|
|
|
|
|
{ |
|
284
|
13
|
100
|
|
|
|
22
|
if($single_and_double_dash) |
|
285
|
|
|
|
|
|
|
{ |
|
286
|
8
|
|
|
|
|
17
|
$completion_function .= "\t\t\t-$option --$option \\\n" ; |
|
287
|
|
|
|
|
|
|
} |
|
288
|
|
|
|
|
|
|
else |
|
289
|
|
|
|
|
|
|
{ |
|
290
|
5
|
100
|
|
|
|
8
|
if(1 == length($option)) |
|
291
|
|
|
|
|
|
|
{ |
|
292
|
3
|
|
|
|
|
6
|
$completion_function .= "\t\t\t-$option \\\n" ; |
|
293
|
|
|
|
|
|
|
} |
|
294
|
|
|
|
|
|
|
else |
|
295
|
|
|
|
|
|
|
{ |
|
296
|
2
|
|
|
|
|
4
|
$completion_function .= "\t\t\t--$option \\\n" ; |
|
297
|
|
|
|
|
|
|
} |
|
298
|
|
|
|
|
|
|
} |
|
299
|
|
|
|
|
|
|
} |
|
300
|
|
|
|
|
|
|
|
|
301
|
3
|
|
|
|
|
8
|
$completion_function .= <<"EOF" ; |
|
302
|
|
|
|
|
|
|
' -- \$cur ) ) |
|
303
|
|
|
|
|
|
|
fi |
|
304
|
|
|
|
|
|
|
|
|
305
|
|
|
|
|
|
|
return 0 |
|
306
|
|
|
|
|
|
|
} |
|
307
|
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
complete -F $completion_function_name $complete_options $command |
|
309
|
|
|
|
|
|
|
EOF |
|
310
|
|
|
|
|
|
|
|
|
311
|
3
|
|
|
|
|
10
|
return $completion_function ; |
|
312
|
|
|
|
|
|
|
} |
|
313
|
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
|
315
|
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
sub de_getop_ify_list |
|
317
|
|
|
|
|
|
|
{ |
|
318
|
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
=head2 de_getop_ify_list(\@completion_list) |
|
320
|
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
Split L option definitions and remove type information |
|
322
|
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
I |
|
324
|
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
=over 2 |
|
326
|
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
=item * \@completion_list - list of options to create completion for |
|
328
|
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
the options can be simple strings or a L specifications |
|
330
|
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
=back |
|
332
|
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
I - an array reference |
|
334
|
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
I - carps if $completion_list is not defined |
|
336
|
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
=cut |
|
338
|
|
|
|
|
|
|
|
|
339
|
4
|
|
|
4
|
1
|
6
|
my ($completion_list) = @_ ; |
|
340
|
|
|
|
|
|
|
|
|
341
|
4
|
50
|
|
|
|
11
|
croak unless defined $completion_list ; |
|
342
|
|
|
|
|
|
|
|
|
343
|
4
|
|
|
|
|
5
|
my @de_getopt_ified_list ; |
|
344
|
|
|
|
|
|
|
|
|
345
|
4
|
|
|
|
|
5
|
for my $switch (@{$completion_list}) |
|
|
4
|
|
|
|
|
7
|
|
|
346
|
|
|
|
|
|
|
{ |
|
347
|
12
|
|
|
|
|
27
|
my @switches = split(/\|/sxm, $switch) ; |
|
348
|
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
#~ print "$switch => \n" ; |
|
350
|
12
|
|
|
|
|
15
|
for (@switches) |
|
351
|
|
|
|
|
|
|
{ |
|
352
|
18
|
|
|
|
|
31
|
s/=.*$//sxm ; |
|
353
|
18
|
|
|
|
|
26
|
s/:.*$//sxm ; |
|
354
|
|
|
|
|
|
|
|
|
355
|
18
|
|
|
|
|
43
|
push @de_getopt_ified_list, $_ ; |
|
356
|
|
|
|
|
|
|
} |
|
357
|
|
|
|
|
|
|
} |
|
358
|
|
|
|
|
|
|
|
|
359
|
4
|
|
|
|
|
10
|
return \@de_getopt_ified_list ; |
|
360
|
|
|
|
|
|
|
} |
|
361
|
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
#------------------------------------------------------------------------------- |
|
363
|
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
1 ; |
|
365
|
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
=head1 BUGS AND LIMITATIONS |
|
367
|
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
None so far. |
|
369
|
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
=head1 AUTHOR |
|
371
|
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
Nadim ibn hamouda el Khemir |
|
373
|
|
|
|
|
|
|
CPAN ID: NH |
|
374
|
|
|
|
|
|
|
mailto: nadim@cpan.org |
|
375
|
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
|
377
|
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
This program is free software; you can redistribute |
|
379
|
|
|
|
|
|
|
it and/or modify it under the same terms as Perl itself. |
|
380
|
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
=head1 SUPPORT |
|
382
|
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
|
384
|
|
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
perldoc Term::Bash::Completion::Generator |
|
386
|
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
You can also look for information at: |
|
388
|
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
=over 4 |
|
390
|
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
|
392
|
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
L |
|
394
|
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
|
396
|
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
Please report any bugs or feature requests to L . |
|
398
|
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
We will be notified, and then you'll automatically be notified of progress on |
|
400
|
|
|
|
|
|
|
your bug as we make changes. |
|
401
|
|
|
|
|
|
|
|
|
402
|
|
|
|
|
|
|
=item * Search CPAN |
|
403
|
|
|
|
|
|
|
|
|
404
|
|
|
|
|
|
|
L |
|
405
|
|
|
|
|
|
|
|
|
406
|
|
|
|
|
|
|
=back |
|
407
|
|
|
|
|
|
|
|
|
408
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
409
|
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
L |
|
411
|
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
L |
|
413
|
|
|
|
|
|
|
|
|
414
|
|
|
|
|
|
|
L |
|
415
|
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
=cut |