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
kkartik.com> 2016-09-30 10:45:14 -0700 3431' href='/akkartik/mu/commit/html/015literal_noninteger.cc.html?h=hlt&id=3e1349d29fa00db1fab3a811b60bc9d8de0355e4'>3e1349d2 ^
e5c11a51 ^
4690ce81 ^
a654e4ec ^
e5c11a51 ^
3e1349d2 ^
a654e4ec ^
70f4e9b6 ^
c5ffb6e1 ^

a654e4ec ^



e5c11a51 ^






















a654e4ec ^

c5ffb6e1 ^
e5c11a51 ^
a654e4ec ^
e5c11a51 ^














































c5ffb6e1 ^


a654e4ec ^
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