about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--enumerate/enumerate.cc17
-rw-r--r--enumerate/makefile2
-rw-r--r--makefile2
3 files changed, 6 insertions, 15 deletions
diff --git a/enumerate/enumerate.cc b/enumerate/enumerate.cc
index 58497909..2777c407 100644
--- a/enumerate/enumerate.cc
+++ b/enumerate/enumerate.cc
@@ -1,3 +1,4 @@
+#include<assert.h>
 #include<cstdlib>
 #include<dirent.h>
 #include<vector>
@@ -7,14 +8,11 @@ using std::string;
 #include<iostream>
 using std::cout;
 
-int enumerate_files_in_cwd_until(string last_file);
-string flag_value(const string& flag, int argc, const char* argv[]);
-
 int main(int argc, const char* argv[]) {
-  return enumerate_files_in_cwd_until(flag_value("--until", argc, argv));
-}
+  assert(argc == 3);
+  assert(string(argv[1]) == "--until");
+  string last_file(argv[2]);
 
-int enumerate_files_in_cwd_until(string last_file) {
   dirent** files;
   int num_files = scandir(".", &files, NULL, alphasort);
   for (int i = 0; i < num_files; ++i) {
@@ -26,10 +24,3 @@ int enumerate_files_in_cwd_until(string last_file) {
   // don't bother freeing files
   return 0;
 }
-
-string flag_value(const string& flag, int argc, const char* argv[]) {
-  for (int i = 1; i < argc-1; ++i)
-    if (string(argv[i]) == flag)
-      return argv[i+1];
-  return "";
-}
diff --git a/enumerate/makefile b/enumerate/makefile
index b8760460..e1a06f63 100644
--- a/enumerate/makefile
+++ b/enumerate/makefile
@@ -1,4 +1,4 @@
-tangle: makefile
+enumerate: makefile enumerate.cc
 	c++ -O3 -Wall -Wextra -fno-strict-aliasing enumerate.cc -o enumerate
 
 clean:
diff --git a/makefile b/makefile
index cc8af389..5dd114c2 100644
--- a/makefile
+++ b/makefile
@@ -16,7 +16,7 @@ core.mu: [0-9]*.mu mu.cc
 	cat $$(./enumerate/enumerate --until zzz |grep '.mu$$') > core.mu
 
 enumerate/enumerate:
-	cd enumerate && make && ./enumerate test
+	cd enumerate && make
 
 tangle/tangle:
 	cd tangle && make && ./tangle test
hlt&id=1b76245c6326c1d60494e102ed0141c7927a640f'>^
2b250717 ^
bff0fa45 ^


9dcbec39 ^
bff0fa45 ^

4e49b29e ^

98f7918b ^

0487a30e ^
6c96a437 ^
0487a30e ^
0487a30e ^
827898fc ^
98f7918b ^


88be3dbc ^
1ead3562 ^
d52406cc ^


98f7918b ^
57699011 ^
98f7918b ^
051c4738 ^
1ead3562 ^
d52406cc ^
0487a30e ^



1ead3562 ^
d52406cc ^
0487a30e ^


051c4738 ^
1ead3562 ^
d52406cc ^
0487a30e ^


1848b18f ^

98f7918b ^
795f5244 ^
e236973b ^
4e49b29e ^
6c96a437 ^
4e49b29e ^
9dcbec39 ^
4e49b29e ^


bff0fa45 ^
2b250717 ^
bff0fa45 ^


9dcbec39 ^
bff0fa45 ^

4e49b29e ^

98f7918b ^

0487a30e ^
6c96a437 ^
0487a30e ^
0487a30e ^
827898fc ^
98f7918b ^


88be3dbc ^
1ead3562 ^
d52406cc ^


98f7918b ^
57699011 ^
d7e11237 ^
051c4738 ^
1ead3562 ^
d52406cc ^
0487a30e ^



1ead3562 ^
d52406cc ^
0487a30e ^


051c4738 ^
1ead3562 ^
d52406cc ^
0487a30e ^


1848b18f ^

d7e11237 ^
795f5244 ^
e236973b ^
4e49b29e ^
67a180e3 ^
2b250717 ^
4e49b29e ^

6c96a437 ^
4e49b29e ^
9dcbec39 ^
4e49b29e ^


6c96a437 ^
bff0fa45 ^

9dcbec39 ^
bff0fa45 ^


4e49b29e ^

d7e11237 ^

e4630643 ^
6c96a437 ^
827898fc ^
0487a30e ^
d7e11237 ^


88be3dbc ^
1ead3562 ^
d52406cc ^

d7e11237 ^
57699011 ^
0487a30e ^

1ead3562 ^
d52406cc ^
0487a30e ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166