error handling layer implemented, header boilerplated for licensing info

This commit is contained in:
Chris Punches
2025-02-27 01:57:21 -05:00
parent e30ed309bd
commit a5e2c86882
14 changed files with 855 additions and 204 deletions

View File

@@ -1,12 +1,44 @@
/**
* @file dpm_interface.hpp
* @brief Interface declarations for the DPM command-line functionality
*
* Defines the public interface methods that provide human-readable interaction
* with the DPM core functionality, including module path validation and
* module listing capabilities.
*
* @copyright Copyright (c) 2025 SILO GROUP LLC
* @author Chris Punches <chris.punches@silogroup.org>
*
* Part of the Dark Horse Linux Package Manager (DPM)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* For bug reports or contributions, please contact the dhlp-contributors
* mailing list at: https://lists.darkhorselinux.org/mailman/listinfo/dhlp-contributors
*/
#pragma once
#include <iostream>
#include <getopt.h>
#include <vector>
#include "error.hpp"
#include <dlfcn.h>
#include <iomanip>
#include <filesystem>
#include "error.hpp"
#include "ModuleLoader.hpp"
#include "dpm_interface_helpers.hpp"
/*
*
@@ -21,16 +53,3 @@ int main_check_module_path(const ModuleLoader& loader);
// list the modules
int main_list_modules(const ModuleLoader& loader);
// data structure for supplied arguments
struct CommandArgs {
std::string module_path;
std::string module_name;
std::string command; // All arguments combined into a single command string
};
// parser for populating data structure for supplied arguments
CommandArgs parse_args(int argc, char* argv[]);
// pairs DPMErrors to error messages, prints those error messages, and returns
int print_error(DPMError error, const std::string& module_name, const std::string& module_path);