mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:47:45 +00:00
keymap: Unveil path, if one is given
This commit is contained in:
parent
0e3408d4d6
commit
2617279579
1 changed files with 11 additions and 6 deletions
|
@ -42,17 +42,22 @@ int main(int argc, char** argv)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unveil(nullptr, nullptr) < 0) {
|
|
||||||
perror("unveil");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* path = nullptr;
|
const char* path = nullptr;
|
||||||
Core::ArgsParser args_parser;
|
Core::ArgsParser args_parser;
|
||||||
args_parser.add_positional_argument(path, "The mapping file to be used", "file", Core::ArgsParser::Required::No);
|
args_parser.add_positional_argument(path, "The mapping file to be used", "file", Core::ArgsParser::Required::No);
|
||||||
args_parser.parse(argc, argv);
|
args_parser.parse(argc, argv);
|
||||||
|
|
||||||
dbgln("path is at {:p}, and contains {}", path, path);
|
if (path && path[0] == '/') {
|
||||||
|
if (unveil(path, "r") < 0) {
|
||||||
|
perror("unveil path");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (unveil(nullptr, nullptr) < 0) {
|
||||||
|
perror("unveil");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (!path) {
|
if (!path) {
|
||||||
auto keymap = Keyboard::CharacterMap::fetch_system_map();
|
auto keymap = Keyboard::CharacterMap::fetch_system_map();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue