mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-25 18:29:51 +01:00
add help
This commit is contained in:
parent
9345a87174
commit
d63c83ed93
1 changed files with 16 additions and 3 deletions
|
@ -8,14 +8,24 @@
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
|
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) {
|
int main(int argc, char** argv, char** envp) {
|
||||||
std::vector<std::string> ARGS{argc};
|
std::vector<std::string> ARGS{argc};
|
||||||
for (int i = 0; i < argc; ++i) {
|
for (int i = 0; i < argc; ++i) {
|
||||||
ARGS[i] = std::string{argv[i]};
|
ARGS[i] = std::string{argv[i]};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ARGS.size() < 2) {
|
if (ARGS.size() < 2 || ARGS[1] == "--help" || ARGS[1] == "-h") {
|
||||||
std::cerr << Colors::RED << "✖" << Colors::RESET << " Not enough args.\n";
|
std::cout << HELP;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,6 +76,9 @@ int main(int argc, char** argv, char** envp) {
|
||||||
g_pPluginManager->ensurePluginsLoadState();
|
g_pPluginManager->ensurePluginsLoadState();
|
||||||
} else if (ARGS[1] == "load") {
|
} else if (ARGS[1] == "load") {
|
||||||
g_pPluginManager->ensurePluginsLoadState();
|
g_pPluginManager->ensurePluginsLoadState();
|
||||||
|
} else {
|
||||||
|
std::cout << HELP;
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue