-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
37 lines (33 loc) · 1 KB
/
main.cpp
File metadata and controls
37 lines (33 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "File_man.h"
#include "SDL_io.h"
#include <args.hxx>
#include <cstdint>
#include <string>
int main(int argc, char **args) {
args::ArgumentParser parser("2n - A very large 2048 clone",
"2n Dev by Julian Barbera");
args::HelpFlag help(parser, "help", "Display this help menue", {'h', "flag"});
args::ValueFlag<uint64_t> newGame(
parser, "size", "Makes a new game with a specific board size",
{'n', "new"});
args::CompletionFlag completion(parser, {"complete"});
try {
parser.ParseCLI(argc, args);
} catch (args::Help) {
std::cout << parser;
} catch (args::ParseError e) {
std::cerr << e.what() << std::endl;
std::cerr << parser;
return 1;
} catch (args::ValidationError e) {
std::cerr << e.what() << std::endl;
std::cerr << parser;
return 1;
}
if (newGame) {
cout << "New game with size " << args::get(newGame) << endl;
system("rm 2nData.dat");
}
SDL_io SDL_io_o;
return SDL_io_o.run(args::get(newGame));
}