reformat main
Some checks failed
build_test / build (push) Has been cancelled

This commit is contained in:
PoliEcho 2025-04-14 10:42:58 +02:00
parent 1b61b87cc7
commit f307ed3448

View File

@ -1,8 +1,8 @@
#include "color.h" #include <unistd.h>
#include "const.h"
#include <cstdlib> #include <cstdlib>
#include <iostream> #include <iostream>
#include <unistd.h> #include "color.h"
#include "const.h"
void PrintHelp() { void PrintHelp() {
std::cout << RED R"( ____ ____ std::cout << RED R"( ____ ____
@ -24,21 +24,21 @@ void PrintVersion() {
exit(0); exit(0);
} }
int main(int argc, char *argv[]) { int main(int argc, char* argv[]) {
int opt; int opt;
while ((opt = getopt(argc, argv, "hV")) != -1) { while ((opt = getopt(argc, argv, "hV")) != -1) {
switch (opt) { switch (opt) {
case 'h': case 'h':
PrintHelp(); PrintHelp();
break; break;
case 'V': case 'V':
PrintVersion(); PrintVersion();
break; break;
default: default:
std::cerr << RED "[ERROR]" << RESET " invalid option: " << (char)optopt std::cerr << RED "[ERROR]" << RESET " invalid option: " << (char)optopt
<< "\ntry: -h\n"; << "\ntry: -h\n";
return EINVAL; return EINVAL;
} }
} }