cleaning up
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
// global errors for the core DPM routing/execution component
|
||||
enum class DPMError {
|
||||
SUCCESS,
|
||||
PATH_NOT_FOUND,
|
||||
|
||||
Reference in New Issue
Block a user