3 * https://github.com/vrmiguel/minishell-2
5 * Copyright (c) 2020 VinÃcius R. Miguel <vinicius.miguel at unifesp.br>
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29 #include <string> // strings
30 #include <vector> // vectors
35 #define RED_ANSI "\x1b[31m" // ANSI escape code for red
36 #define BLUE_ANSI "\x1b[34m" // ANSI escape code for blue
37 #define RESET_ANSI "\x1b[0m" // ANSI escape code to reset stdout's color
38 #define KEY_UP 72 // ASCII code for arrow key up
39 #define KEY_LEFT 75 // ASCII code for arrow key left
40 #define KEY_RIGHT 77 // ASCII code for arrow key right
41 #define KEY_DOWN 80 // ASCII code for arrow key down
43 extern bool is_verbose
;
44 extern bool cwd_changed
;
50 * \brief Constructor for CLIInputs.
51 * \param argc Command-line argument count.
52 * \param argv Array of strings that representing the command-line argument given.
54 CLIInputs(unsigned short argc
, char ** argv
);
60 vector
<string
> tokens
;
65 void parse(string input
);