diff options
author | Vaxry <[email protected]> | 2023-12-06 16:40:40 +0000 |
---|---|---|
committer | Vaxry <[email protected]> | 2023-12-06 23:31:03 +0000 |
commit | d63c83ed93ed980cbd4c9496ca9742db976bac66 (patch) | |
tree | 39bfb2a31b355a1cce3a8783b3c30fbdb113a5fc | |
parent | 9345a8717488ba0f26343d621477f1e2065aff40 (diff) | |
download | Hyprland-d63c83ed93ed980cbd4c9496ca9742db976bac66.tar.gz Hyprland-d63c83ed93ed980cbd4c9496ca9742db976bac66.zip |
add help
-rw-r--r-- | hyprpm/src/main.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/hyprpm/src/main.cpp b/hyprpm/src/main.cpp index c6f083a8..62d4cee1 100644 --- a/hyprpm/src/main.cpp +++ b/hyprpm/src/main.cpp @@ -8,14 +8,24 @@ #include <chrono> #include <thread> -int main(int argc, char** argv, char** envp) { +const std::string HELP = R"#(┏ hyprpm, a Hyprland Plugin Manager +┃ +┣ add [url] → Install a new plugin repository from git +┣ remove [url/name] → Remove an installed plugin repository +┣ enable [name] → Enable a plugin +┣ disable [name] → Disable a plugin +┣ load → Load hyprpm state. Ensure all enabled plugins are loaded. +┗ +)#"; + +int main(int argc, char** argv, char** envp) { std::vector<std::string> ARGS{argc}; for (int i = 0; i < argc; ++i) { ARGS[i] = std::string{argv[i]}; } - if (ARGS.size() < 2) { - std::cerr << Colors::RED << "✖" << Colors::RESET << " Not enough args.\n"; + if (ARGS.size() < 2 || ARGS[1] == "--help" || ARGS[1] == "-h") { + std::cout << HELP; return 1; } @@ -66,6 +76,9 @@ int main(int argc, char** argv, char** envp) { g_pPluginManager->ensurePluginsLoadState(); } else if (ARGS[1] == "load") { g_pPluginManager->ensurePluginsLoadState(); + } else { + std::cout << HELP; + return 1; } return 0; |