feat: Update 3 files
All checks were successful
Build-Test-Publish / build (linux/amd64) (push) Successful in 24s
Build-Test-Publish / build (linux/arm64) (push) Successful in 29s

This commit is contained in:
2025-09-30 12:57:00 +13:00
parent dc717b7064
commit 380f518af8
3 changed files with 24 additions and 2 deletions

Binary file not shown.

View File

@@ -9,20 +9,42 @@
void printUsage(const std::string& program) {
std::cerr << "Usage: " << program << " [-v] <file_or_directory_path>\n";
std::cerr << " " << program << " version\n";
std::cerr << " " << program << " autocomplete <args>\n";
std::cerr << " -v Verbose mode (list files as they are processed)\n";
}
int main(int argc, char* argv[]) {
if (argc < 2 || argc > 3) {
if (argc < 2) {
printUsage(argv[0]);
return 1;
}
// Check for version command
if (argc == 2 && std::string(argv[1]) == "version") {
std::cout << DSHASH_VERSION << std::endl;
return 0;
}
// Check for autocomplete command
if (std::string(argv[1]) == "autocomplete") {
// Return available options for autocomplete
std::cout << "-v\n";
std::cout << "version\n";
// Suggest files and directories in current directory
try {
for (const auto& entry : std::filesystem::directory_iterator(".")) {
std::cout << entry.path().filename().string() << "\n";
}
} catch (...) {
// Ignore errors in autocomplete
}
return 0;
}
if (argc > 3) {
printUsage(argv[0]);
return 1;
}
bool verbose = false;
std::string path;

Binary file not shown.