actually using and building it
This commit is contained in:
parent
9a6177092f
commit
16e8051557
@ -1,4 +1,4 @@
|
|||||||
bin_PROGRAMS = cellar
|
bin_PROGRAMS = cellar
|
||||||
cellar_CPPFLAGS = $(BOOST_CPPFLAGS)
|
cellar_CPPFLAGS = $(BOOST_CPPFLAGS)
|
||||||
cellar_LDFLAGS = $(BOOST_LDFLAGS) $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB)
|
cellar_LDFLAGS = $(BOOST_LDFLAGS) $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB)
|
||||||
cellar_SOURCES = cellar.cpp
|
cellar_SOURCES = cellar.cpp fs.cpp
|
||||||
|
@ -1,28 +1,21 @@
|
|||||||
|
#include <cstdlib>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include <boost/filesystem/operations.hpp>
|
#include <boost/filesystem/operations.hpp>
|
||||||
#include <boost/filesystem/path.hpp>
|
#include <boost/filesystem/path.hpp>
|
||||||
|
|
||||||
namespace fs = boost::filesystem;
|
#include "fs.hpp"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
fs::path cwd(fs::current_path());
|
vector<string> homedir = cellar::fs::listdir(getenv("HOME"));
|
||||||
cwd = fs::system_complete(".");
|
for (string item : homedir) {
|
||||||
fs::directory_iterator iter_end;
|
cout << item;
|
||||||
|
cout << " ";
|
||||||
for (fs::directory_iterator iter_cwd(cwd); iter_cwd != iter_end; ++iter_cwd) {
|
}
|
||||||
try {
|
cout << endl;
|
||||||
std::string item = iter_cwd->path().filename().native();
|
|
||||||
|
|
||||||
std::cout << item;
|
|
||||||
std::cout << " ";
|
|
||||||
}
|
|
||||||
catch (const std::exception& exc) {
|
|
||||||
std::cout << "[1;31mfuck[0m" << std::endl;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
std::cout << std::endl;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user