diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2021-05-12 13:56:43 +0430 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-05-12 11:00:45 +0100 |
commit | a91a49337c5992d64b30f493eea1eb492792b667 (patch) | |
tree | b665e2c0b31a9935ca8a8f8b5b71bbadf476e32f /Userland/Shell/Shell.cpp | |
parent | 422ef7904e9eb6be1182421a7529ed0d5e00991f (diff) | |
download | serenity-a91a49337c5992d64b30f493eea1eb492792b667.zip |
LibCore+Everywhere: Move OpenMode out of IODevice
...and make it an enum class so people don't omit "OpenMode".
Diffstat (limited to 'Userland/Shell/Shell.cpp')
-rw-r--r-- | Userland/Shell/Shell.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Shell/Shell.cpp b/Userland/Shell/Shell.cpp index f64a2708d7..332b644b6a 100644 --- a/Userland/Shell/Shell.cpp +++ b/Userland/Shell/Shell.cpp @@ -879,7 +879,7 @@ void Shell::execute_process(Vector<const char*>&& argv) } if (saved_errno == ENOENT) { do { - auto file_result = Core::File::open(argv[0], Core::IODevice::OpenMode::ReadOnly); + auto file_result = Core::File::open(argv[0], Core::OpenMode::ReadOnly); if (file_result.is_error()) break; auto& file = file_result.value(); @@ -1012,7 +1012,7 @@ bool Shell::run_file(const String& filename, bool explicitly_invoked) TemporaryChange interactive_change { m_is_interactive, false }; TemporaryChange<Optional<SourcePosition>> source_change { m_source_position, SourcePosition { .source_file = filename, .literal_source_text = {}, .position = {} } }; - auto file_result = Core::File::open(filename, Core::File::ReadOnly); + auto file_result = Core::File::open(filename, Core::OpenMode::ReadOnly); if (file_result.is_error()) { auto error = String::formatted("'{}': {}", escape_token_for_single_quotes(filename), file_result.error()); if (explicitly_invoked) @@ -1995,7 +1995,7 @@ void Shell::possibly_print_error() const i64 line_to_skip_to = max(source_position.position->start_line.line_number, 2ul) - 2; if (!source_position.source_file.is_null()) { - auto file = Core::File::open(source_position.source_file, Core::IODevice::OpenMode::ReadOnly); + auto file = Core::File::open(source_position.source_file, Core::OpenMode::ReadOnly); if (file.is_error()) { warnln("Shell: Internal error while trying to display source information: {} (while reading '{}')", file.error(), source_position.source_file); return; |