mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-26 01:29:49 +01:00
fix hyprctl with relative negative
This commit is contained in:
parent
21217bcb2b
commit
c6c3d66373
1 changed files with 5 additions and 1 deletions
|
@ -202,6 +202,10 @@ std::deque<std::string> splitArgs(int argc, char** argv) {
|
|||
return result;
|
||||
}
|
||||
|
||||
bool isNumber(const std::string& str, bool allowfloat) {
|
||||
return std::ranges::all_of(str.begin(), str.end(), [&](char c) { return isdigit(c) != 0 || c == '-' || (allowfloat && c == '.'); });
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
int bflag = 0, sflag = 0, index, c;
|
||||
|
||||
|
@ -215,7 +219,7 @@ int main(int argc, char** argv) {
|
|||
const auto ARGS = splitArgs(argc, argv);
|
||||
|
||||
for (auto i = 0; i < ARGS.size(); ++i) {
|
||||
if (ARGS[i][0] == '-') {
|
||||
if (ARGS[i][0] == '-' && !isNumber(ARGS[i], true) /* For stuff like -2 */) {
|
||||
// parse
|
||||
if (ARGS[i] == "-j" && !fullArgs.contains("j")) {
|
||||
fullArgs += "j";
|
||||
|
|
Loading…
Reference in a new issue