This commit is contained in:
parent
1b61b87cc7
commit
f307ed3448
28
src/main.cpp
28
src/main.cpp
@ -1,8 +1,8 @@
|
||||
#include "color.h"
|
||||
#include "const.h"
|
||||
#include <unistd.h>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <unistd.h>
|
||||
#include "color.h"
|
||||
#include "const.h"
|
||||
|
||||
void PrintHelp() {
|
||||
std::cout << RED R"( ____ ____
|
||||
@ -24,21 +24,21 @@ void PrintVersion() {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
int main(int argc, char* argv[]) {
|
||||
|
||||
int opt;
|
||||
while ((opt = getopt(argc, argv, "hV")) != -1) {
|
||||
switch (opt) {
|
||||
case 'h':
|
||||
PrintHelp();
|
||||
break;
|
||||
case 'V':
|
||||
PrintVersion();
|
||||
break;
|
||||
default:
|
||||
std::cerr << RED "[ERROR]" << RESET " invalid option: " << (char)optopt
|
||||
<< "\ntry: -h\n";
|
||||
return EINVAL;
|
||||
case 'h':
|
||||
PrintHelp();
|
||||
break;
|
||||
case 'V':
|
||||
PrintVersion();
|
||||
break;
|
||||
default:
|
||||
std::cerr << RED "[ERROR]" << RESET " invalid option: " << (char)optopt
|
||||
<< "\ntry: -h\n";
|
||||
return EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user