Add a display server and graphical user interface #38

Merged
apio merged 103 commits from display-server into main 2023-09-20 18:49:21 +00:00
Showing only changes of commit 0e8183d2bb - Show all commits

View File

@ -85,6 +85,7 @@ Result<int> luna_main(int argc, char** argv)
{ {
StringView path; StringView path;
StringView command; StringView command;
bool interactive { false };
SharedPtr<File> input_file; SharedPtr<File> input_file;
@ -93,6 +94,7 @@ Result<int> luna_main(int argc, char** argv)
parser.add_system_program_info("sh"_sv); parser.add_system_program_info("sh"_sv);
parser.add_positional_argument(path, "path"_sv, "-"_sv); parser.add_positional_argument(path, "path"_sv, "-"_sv);
parser.add_value_argument(command, 'c', "command"_sv, "execute a single command and then exit"_sv); parser.add_value_argument(command, 'c', "command"_sv, "execute a single command and then exit"_sv);
parser.add_switch_argument(interactive, 'i', "interactive"_sv, "run an interactive shell"_sv);
parser.parse(argc, argv); parser.parse(argc, argv);
// TODO: This does not properly handle builtins. // TODO: This does not properly handle builtins.
@ -105,7 +107,7 @@ Result<int> luna_main(int argc, char** argv)
input_file->set_close_on_exec(); input_file->set_close_on_exec();
} }
bool interactive = isatty(input_file->fd()); if (isatty(input_file->fd())) interactive = true;
if (interactive) if (interactive)
{ {