summaryrefslogtreecommitdiff
path: root/hyprpm/src/main.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2025-02-24 13:11:25 +0000
committerVaxry <vaxry@vaxry.net>2025-02-24 13:11:30 +0000
commit73ae9790f994fe3f0194a5e225106c3dddb77d84 (patch)
tree83c31aef7ac55224930fc2f5e53f803f794e2c17 /hyprpm/src/main.cpp
parent3458d7ac93a101ea534ef6d0bcbc32725e267045 (diff)
hyprpm: add --hl-url for custom forks
Diffstat (limited to 'hyprpm/src/main.cpp')
-rw-r--r--hyprpm/src/main.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/hyprpm/src/main.cpp b/hyprpm/src/main.cpp
index 887bb436..9f2411b0 100644
--- a/hyprpm/src/main.cpp
+++ b/hyprpm/src/main.cpp
@@ -29,6 +29,7 @@ constexpr std::string_view HELP = R"#(┏ hyprpm, a Hyprland Plugin Manager
┣ --verbose | -v → Enable too much logging
┣ --force | -f → Force an operation ignoring checks (e.g. update -f)
┣ --no-shallow | -s → Disable shallow cloning of Hyprland sources
+┣ --hl-url | → Pass a custom hyprland source url
┗
)#";
@@ -45,6 +46,7 @@ int main(int argc, char** argv, char** envp) {
std::vector<std::string> command;
bool notify = false, notifyFail = false, verbose = false, force = false, noShallow = false;
+ std::string customHlUrl;
for (int i = 1; i < argc; ++i) {
if (ARGS[i].starts_with("-")) {
@@ -59,6 +61,13 @@ int main(int argc, char** argv, char** envp) {
verbose = true;
} else if (ARGS[i] == "--no-shallow" || ARGS[i] == "-s") {
noShallow = true;
+ } else if (ARGS[i] == "--hl-url") {
+ if (i + 1 >= argc) {
+ std::println(stderr, "Missing argument for --hl-url");
+ return 1;
+ }
+ customHlUrl = ARGS[i + 1];
+ i++;
} else if (ARGS[i] == "--force" || ARGS[i] == "-f") {
force = true;
std::println("{}", statusString("!", Colors::RED, "Using --force, I hope you know what you are doing."));
@@ -66,9 +75,8 @@ int main(int argc, char** argv, char** envp) {
std::println(stderr, "Unrecognized option {}", ARGS[i]);
return 1;
}
- } else {
+ } else
command.push_back(ARGS[i]);
- }
}
if (command.empty()) {
@@ -76,9 +84,10 @@ int main(int argc, char** argv, char** envp) {
return 1;
}
- g_pPluginManager = std::make_unique<CPluginManager>();
- g_pPluginManager->m_bVerbose = verbose;
- g_pPluginManager->m_bNoShallow = noShallow;
+ g_pPluginManager = std::make_unique<CPluginManager>();
+ g_pPluginManager->m_bVerbose = verbose;
+ g_pPluginManager->m_bNoShallow = noShallow;
+ g_pPluginManager->m_szCustomHlUrl = customHlUrl;
if (command[0] == "add") {
if (command.size() < 2) {