summaryrefslogtreecommitdiff
path: root/Userland/Shell
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2022-12-21 21:00:22 +0000
committerTim Flynn <trflynn89@pm.me>2023-01-27 08:07:24 -0500
commit95b1cf2dcd7caa8303b76f60853c9c164fa60616 (patch)
tree7f5f55a3b3bd2abacc79a101a563f8525dc5504b /Userland/Shell
parentba51e2dd3f4cbda3a3f446c4dd30c770dc088bb0 (diff)
downloadserenity-95b1cf2dcd7caa8303b76f60853c9c164fa60616.zip
Shell: Replace uses of JsonObject::get_deprecated()/get_ptr()
Diffstat (limited to 'Userland/Shell')
-rw-r--r--Userland/Shell/Shell.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/Userland/Shell/Shell.cpp b/Userland/Shell/Shell.cpp
index c91ca7a3bd..3a74789ec0 100644
--- a/Userland/Shell/Shell.cpp
+++ b/Userland/Shell/Shell.cpp
@@ -1880,32 +1880,32 @@ ErrorOr<Vector<Line::CompletionSuggestion>> Shell::complete_via_program_itself(s
auto parsed = parsed_result.release_value();
if (parsed.is_object()) {
auto& object = parsed.as_object();
- auto kind = object.get_deprecated("kind"sv).as_string_or("plain");
+ auto kind = object.get_deprecated_string("kind"sv).value_or("plain");
if (kind == "path") {
- auto base = object.get_deprecated("base"sv).as_string_or("");
- auto part = object.get_deprecated("part"sv).as_string_or("");
- auto executable_only = object.get_deprecated("executable_only"sv).to_bool(false) ? ExecutableOnly::Yes : ExecutableOnly::No;
+ auto base = object.get_deprecated_string("base"sv).value_or("");
+ auto part = object.get_deprecated_string("part"sv).value_or("");
+ auto executable_only = object.get_bool("executable_only"sv).value_or(false) ? ExecutableOnly::Yes : ExecutableOnly::No;
suggestions.extend(complete_path(base, part, part.length(), executable_only, nullptr, nullptr));
} else if (kind == "program") {
- auto name = object.get_deprecated("name"sv).as_string_or("");
+ auto name = object.get_deprecated_string("name"sv).value_or("");
suggestions.extend(complete_program_name(name, name.length()));
} else if (kind == "proxy") {
if (m_completion_stack_info.size_free() < 4 * KiB) {
dbgln("Not enough stack space, recursion?");
return IterationDecision::Continue;
}
- auto argv = object.get_deprecated("argv"sv).as_string_or("");
+ auto argv = object.get_deprecated_string("argv"sv).value_or("");
dbgln("Proxy completion for {}", argv);
suggestions.extend(complete(argv));
} else if (kind == "plain") {
Line::CompletionSuggestion suggestion {
- object.get_deprecated("completion"sv).as_string_or(""),
- object.get_deprecated("trailing_trivia"sv).as_string_or(""),
- object.get_deprecated("display_trivia"sv).as_string_or(""),
+ object.get_deprecated_string("completion"sv).value_or(""),
+ object.get_deprecated_string("trailing_trivia"sv).value_or(""),
+ object.get_deprecated_string("display_trivia"sv).value_or(""),
};
- suggestion.static_offset = object.get_deprecated("static_offset"sv).to_u64(0);
- suggestion.invariant_offset = object.get_deprecated("invariant_offset"sv).to_u64(0);
- suggestion.allow_commit_without_listing = object.get_deprecated("allow_commit_without_listing"sv).to_bool(true);
+ suggestion.static_offset = object.get_u64("static_offset"sv).value_or(0);
+ suggestion.invariant_offset = object.get_u64("invariant_offset"sv).value_or(0);
+ suggestion.allow_commit_without_listing = object.get_bool("allow_commit_without_listing"sv).value_or(true);
suggestions.append(move(suggestion));
} else {
dbgln("LibLine: Unhandled completion kind: {}", kind);