diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-05-05 21:17:24 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-05-05 21:17:24 -0700 |
commit | b96af395b9af2ff9df94b3e82213171f30827c8d (patch) | |
tree | 17c8c12648ccc25625e2534ec8d74fbe8f1542cc /cpp/enumerate | |
parent | 2e3b597fe85b654e82b891c22d50754fa5a26156 (diff) | |
download | mu-b96af395b9af2ff9df94b3e82213171f30827c8d.tar.gz |
1276 - make C++ version the default
I've tried to update the Readme, but there are at least a couple of issues.
Diffstat (limited to 'cpp/enumerate')
-rw-r--r-- | cpp/enumerate/enumerate.cc | 35 | ||||
-rw-r--r-- | cpp/enumerate/makefile | 5 |
2 files changed, 0 insertions, 40 deletions
diff --git a/cpp/enumerate/enumerate.cc b/cpp/enumerate/enumerate.cc deleted file mode 100644 index 02349213..00000000 --- a/cpp/enumerate/enumerate.cc +++ /dev/null @@ -1,35 +0,0 @@ -#include<cstdlib> -#include<dirent.h> -#include<vector> -using std::vector; -#include<string> -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)); -} - -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) { - string curr_file = files[i]->d_name; - if (!isdigit(curr_file[0])) continue; - if (!last_file.empty() && curr_file > last_file) break; - cout << curr_file << '\n'; - } - // 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/cpp/enumerate/makefile b/cpp/enumerate/makefile deleted file mode 100644 index f2d0e460..00000000 --- a/cpp/enumerate/makefile +++ /dev/null @@ -1,5 +0,0 @@ -tangle: makefile - g++ -O3 -Wall -Wextra -fno-strict-aliasing enumerate.cc -o enumerate - -clean: - -rm enumerate |