Zappy - Year end project
2
This is a project that Epitech asked us to create in order to allow us to reveiw the notions of the current year.
Loading...
Searching...
No Matches
src
gui_client
src
sub_main.cpp
Go to the documentation of this file.
1
/*
2
** EPITECH PROJECT, 2023
3
** my_zappy [fed34_prox_vm]
4
** File description:
5
** sub_main.cpp
6
*/
7
8
#include <iostream>
9
#include "
Parsing.hpp
"
10
#include "
ArgumentHandling.hpp
"
11
12
int
sub_main
(
int
argc,
char
**argv)
13
{
14
Gui::Parsing
p;
15
16
try
{
17
if
(p.
parse_args
(argc, argv) !=
true
) {
18
p.
help
();
19
return
84;
20
}
21
22
if
(p.
validate_args
() !=
true
) {
23
p.
help
();
24
return
84;
25
}
26
27
p.
print_args
();
28
}
catch
(
const
Exception::ArgumentHandling
&e) {
29
std::cerr <<
"Error: "
<< e.
what
() << std::endl;
30
p.
help
();
31
return
84;
32
}
33
return
0;
34
}
ArgumentHandling.hpp
Parsing.hpp
Exception::ArgumentHandling
Definition
ArgumentHandling.hpp:16
Exception::ArgumentHandling::what
const char * what() const noexcept override
Definition
ArgumentHandling.cpp:18
Gui::Parsing
Definition
Parsing.hpp:14
Gui::Parsing::print_args
void print_args() const
Definition
Parsing.cpp:46
Gui::Parsing::help
void help() const
Definition
Parsing.cpp:17
Gui::Parsing::parse_args
bool parse_args(int ac, char **av)
Definition
Parsing.cpp:22
Gui::Parsing::validate_args
bool validate_args() const
Definition
Parsing.cpp:38
sub_main
int sub_main(int argc, char **argv)
This is the main function of the program (this is the function called by the main used for compiling)
Definition
sub_main.cpp:12