Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorH028 committed Mar 31, 2024
1 parent af1cc52 commit 1fee645
Show file tree
Hide file tree
Showing 113 changed files with 12 additions and 28 deletions.
1 change: 0 additions & 1 deletion .deb/i-haklab/home/.local/etc/i-Haklab/Tools/Readme/N/n.md

This file was deleted.

Binary file modified build/CMakeFiles/i-haklab.dir/main-haklab.cpp.o
Binary file not shown.
Binary file modified build/i-haklab
Binary file not shown.
35 changes: 9 additions & 26 deletions include/below_zero.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,44 +157,27 @@ class Haklab {

void about(std::string about) {
fs::path fren = IHETC /= std::basic_string("/Tools/Readme/");
char ab = std::toupper(about[0]);
string s(1,ab);
// Directorio base
if (!fs::is_directory(IHETC)) {
cerr << "[ERROR] " << IHETC << endl;
cerr << "[ERROR] No found " << IHETC << endl;
};
// Archivos
if (fs::exists(fren /= std::to_string(std::toupper(about[0])))) {
vector<string> files;
for(const auto &entry : fs::directory_iterator(fren /= std::to_string(std::toupper(about[0])))){
if(entry.is_regular_file() && entry.path().filename().extension() == ".md"){
files.push_back(entry.path().filename().stem().string());
}
};
if (!fs::exists(fren /= s)) {
cerr << "No tengo esta inicial " << s << endl;
};

bool encontrado{false};
for(const auto& file : files){
if (file == about) {
encontrado = true;
break;
}
}

if(encontrado){
std::fstream fd(fren.string() + std::to_string(std::toupper(about[0])) + about.c_str());
std::fstream fd(fren.c_str() + string( "/") + about.c_str() + ".md");
if (fd.is_open()) {
std::stringstream buffer;
buffer << fd.rdbuf();
fd.close();
syntax_highlight(buffer.str());
}
syntax_highlight(buffer.str());
} else {
cout << "No se encontró '" << about << "', archivos disponibles con inicial '" << about[0] << "':" << endl;
for (const auto &file : files) {
cout << " - " << file << endl;
}
cout << "Ufff no pude abrir el archivo " << endl;
}
} else {
cout << "No se encontró la carpeta para la letra '" << std::toupper(about[0]) << "'" << endl;
}
}
}; // end class
}; // namespace haklab
Expand Down
4 changes: 3 additions & 1 deletion main-haklab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ int main(int argc, const char *argv[]){
->default_value(LOCALHOST)
->value_name("string"),
"Host to connect ")
("out-dir", po::value<string>()->value_name("path"), "...")
("out-dir", po::value<string>()
->value_name("path"), "...")
("interface", po::value<string>()->default_value("wlan0"), "..")
("help", "Produce help message");
/*
*
Expand Down

0 comments on commit 1fee645

Please sign in to comment.