cleaning up

This commit is contained in:
Chris Punches
2025-02-23 04:20:52 -05:00
parent 6a91f30ce2
commit 5be17a0a05
5 changed files with 36 additions and 34 deletions

View File

@@ -9,6 +9,7 @@
class ModuleLoader {
public:
// initializer
explicit ModuleLoader(std::string module_path = "/usr/lib/dpm/modules/");
DPMError list_available_modules(std::vector<std::string>& modules) const;
DPMError get_module_path(std::string& path) const;

View File

@@ -24,10 +24,13 @@ int main_list_modules(const ModuleLoader& loader);
// data structure for supplied arguments
struct CommandArgs {
std::string module_path = "/usr/lib/dpm/modules/";
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[]);
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);

View File

@@ -1,5 +1,6 @@
#pragma once
// global errors for the core DPM routing/execution component
enum class DPMError {
SUCCESS,
PATH_NOT_FOUND,