mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 18:32:28 -05: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;
|
||||
}
|
||||
|
||||
if (unveil(nullptr, nullptr) < 0) {
|
||||
perror("unveil");
|
||||
return 1;
|
||||
}
|
||||
|
||||
const char* path = nullptr;
|
||||
Core::ArgsParser args_parser;
|
||||
args_parser.add_positional_argument(path, "The mapping file to be used", "file", Core::ArgsParser::Required::No);
|
||||
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) {
|
||||
auto keymap = Keyboard::CharacterMap::fetch_system_map();
|
||||
|
|
Loading…
Add table
Reference in a new issue