/**
* 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 .
*/
#include
#include
#include
#include
#include "cli.h"
cli_options new_options() {
cli_options result;
result.config_file.has_value = false;
result.config_file.value = NULL;
result.executors = 32;
result.verbosity = 1;
result.help = false;
result.version = false;
char *no_color = getenv("NO_COLOR");
bool color = true;
if(no_color != NULL && no_color[0] != '\0')
color = false;
result.use_colors = color;
result.log_file.has_value = false;
result.log_file.value = NULL;
result.pipeline_log_dir.has_value = false;
result.pipeline_log_dir.value = NULL;
return result;
}
void destroy_options(cli_options v) {
if(v.config_file.has_value)
free(v.config_file.value);
if(v.log_file.has_value)
free(v.log_file.value);
if(v.pipeline_log_dir.has_value)
free(v.pipeline_log_dir.value);
}
//