2024-08-19 19:06:49 +02:00
|
|
|
/**
|
|
|
|
* sci - a simple ci system
|
|
|
|
Copyright (C) 2024 Asger Gitz-Johansen
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2024-08-02 19:11:12 +02:00
|
|
|
#ifndef SCI_CLI_H
|
|
|
|
#define SCI_CLI_H
|
|
|
|
#include "optional.h"
|
2024-08-04 12:45:32 +02:00
|
|
|
#include <stdio.h>
|
2024-08-02 19:11:12 +02:00
|
|
|
|
2024-08-03 09:21:21 +02:00
|
|
|
typedef struct {
|
2024-08-03 13:08:46 +02:00
|
|
|
optional_str config_file;
|
|
|
|
int executors;
|
2024-08-02 19:11:12 +02:00
|
|
|
int verbosity;
|
|
|
|
bool help;
|
|
|
|
bool version;
|
2024-08-03 09:21:21 +02:00
|
|
|
bool use_colors;
|
|
|
|
optional_str log_file;
|
2024-08-06 20:05:20 +02:00
|
|
|
optional_str pipeline_log_dir;
|
2024-08-03 09:21:21 +02:00
|
|
|
} cli_options;
|
2024-08-02 19:11:12 +02:00
|
|
|
|
|
|
|
// Construct a new cli_options struct instance.
|
2024-08-03 09:21:21 +02:00
|
|
|
cli_options new_options();
|
2024-08-02 19:11:12 +02:00
|
|
|
|
|
|
|
// Delete a cli_options struct instance.
|
2024-08-03 13:08:46 +02:00
|
|
|
void destroy_options(cli_options v);
|
2024-08-02 19:11:12 +02:00
|
|
|
|
|
|
|
// Print the help message.
|
|
|
|
void print_help(FILE * out, char* prog_name);
|
|
|
|
|
|
|
|
// Parse the command line arguments and give a new cli_options struct instance.
|
2024-08-03 09:21:21 +02:00
|
|
|
cli_options parse(int argc, char** argv);
|
2024-08-02 19:11:12 +02:00
|
|
|
|
|
|
|
#endif
|