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
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
12int sub_main(int argc, char **argv)
13{
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}
const char * what() const noexcept override
void print_args() const
Definition Parsing.cpp:46
void help() const
Definition Parsing.cpp:17
bool parse_args(int ac, char **av)
Definition Parsing.cpp:22
bool validate_args() const
Definition Parsing.cpp:38
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