#include #include #include #include "JSystem/JFilesystem.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * Example program to use JSYSTEM::ls. * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; int debug; try { JParser<> zap("Example program to mimic shell ls command"); zap['d'] = make_field(debug) = 0; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } string option; for (int i = 1; i != argc; ++i) { option += " "; option += argv[i]; } ls buffer(option.c_str()); for (ls::const_iterator i = buffer.begin(); i != buffer.end(); ++i) { cout << *i << endl; } }