File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change 1
1
# !/usr/bin/env perl6
2
2
use v6 ;
3
3
4
- sub MAIN () {
5
- my $ outfile = " index.ini" ;
4
+ my $ index_file = " index.data" ;
5
+ multi sub MAIN () {
6
+ say " Usage: $ * PROGRAM_NAME index to index the docs" ;
7
+ say " Usage: $ * PROGRAM_NAME list to list the names" ;
8
+ }
9
+
10
+ multi sub MAIN (' index' ) {
6
11
my % words ;
7
12
for dir(' lib' ) -> $ file {
8
13
my $ pod = substr ($ file . Str , 0 , $ file . Str . chars -4 );
20
25
}
21
26
}
22
27
}
23
- my $ out = open (' index.data ' , : w);
28
+ my $ out = open ($ index_file , : w);
24
29
$ out . print (% words . perl );
25
30
$ out . close ;
26
31
}
32
+ multi sub MAIN (' list' ) {
33
+ if $ index_file . IO ~~ : e {
34
+ my % data = eval slurp $ index_file ;
35
+ for % data . keys . sort -> $ name {
36
+ say $ name
37
+ # my $newdoc = %data{$docee}[0][0] ~ "." ~ %data{$docee}[0][1];
38
+ # return MAIN($newdoc, :f);
39
+ }
40
+ } else {
41
+ say " First run $ * PROGRAM_NAME index to create the index" ;
42
+ exit ;
43
+ }
44
+ }
27
45
You can’t perform that action at this time.
0 commit comments