mirror of
https://github.com/hyprwm/hyprlock.git
synced 2025-05-13 05:40:42 +01:00
core: print hyprlock version in the logs (#703)
This commit is contained in:
parent
78ad1d46b5
commit
a13b6f0d1a
1 changed files with 10 additions and 6 deletions
16
src/main.cpp
16
src/main.cpp
|
@ -29,6 +29,14 @@ std::optional<std::string> parseArg(const std::vector<std::string>& args, const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void printVersion() {
|
||||||
|
constexpr bool ISTAGGEDRELEASE = std::string_view(HYPRLOCK_COMMIT) == HYPRLOCK_VERSION_COMMIT;
|
||||||
|
if (ISTAGGEDRELEASE)
|
||||||
|
std::println("Hyprlock version v{}", HYPRLOCK_VERSION);
|
||||||
|
else
|
||||||
|
std::println("Hyprlock version v{} (commit {})", HYPRLOCK_VERSION, HYPRLOCK_COMMIT);
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char** argv, char** envp) {
|
int main(int argc, char** argv, char** envp) {
|
||||||
std::string configPath;
|
std::string configPath;
|
||||||
std::string wlDisplay;
|
std::string wlDisplay;
|
||||||
|
@ -47,12 +55,7 @@ int main(int argc, char** argv, char** envp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arg == "--version" || arg == "-V") {
|
if (arg == "--version" || arg == "-V") {
|
||||||
constexpr bool ISTAGGEDRELEASE = std::string_view(HYPRLOCK_COMMIT) == HYPRLOCK_VERSION_COMMIT;
|
printVersion();
|
||||||
if (ISTAGGEDRELEASE)
|
|
||||||
std::println("Hyprlock version v{}", HYPRLOCK_VERSION);
|
|
||||||
else
|
|
||||||
std::println("Hyprlock version v{} (commit {})", HYPRLOCK_VERSION, HYPRLOCK_COMMIT);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,6 +93,7 @@ int main(int argc, char** argv, char** envp) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printVersion();
|
||||||
g_pAnimationManager = makeUnique<CHyprlockAnimationManager>();
|
g_pAnimationManager = makeUnique<CHyprlockAnimationManager>();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue