summaryrefslogtreecommitdiff
path: root/Userland/Utilities/ddate.cpp
diff options
context:
space:
mode:
authorKenneth Myhra <kennethmyhra@gmail.com>2021-12-07 20:13:13 +0100
committerBrian Gianforcaro <b.gianfo@gmail.com>2021-12-16 02:10:47 -0800
commit156899a63fd67900992d934637eb815f7bdd1d9e (patch)
tree0f3fd1718935dd7474549e1d7925f5dfd174ad88 /Userland/Utilities/ddate.cpp
parent208d85e707c8c63513d522dabade5ec7d83d184b (diff)
downloadserenity-156899a63fd67900992d934637eb815f7bdd1d9e.zip
ddate: Port to LibMain
Diffstat (limited to 'Userland/Utilities/ddate.cpp')
-rw-r--r--Userland/Utilities/ddate.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/Userland/Utilities/ddate.cpp b/Userland/Utilities/ddate.cpp
index 9e68eb2aa1..261f363768 100644
--- a/Userland/Utilities/ddate.cpp
+++ b/Userland/Utilities/ddate.cpp
@@ -6,7 +6,8 @@
#include <AK/String.h>
#include <LibCore/DateTime.h>
-#include <stdio.h>
+#include <LibCore/System.h>
+#include <LibMain/Main.h>
#include <unistd.h>
class DiscordianDate {
@@ -99,12 +100,9 @@ private:
}
};
-int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv)
+ErrorOr<int> serenity_main(Main::Arguments)
{
- if (pledge("stdio", nullptr) < 0) {
- perror("pledge");
- return 1;
- }
+ TRY(Core::System::pledge("stdio"));
auto date = Core::DateTime::now();
outln("Today is {}", DiscordianDate(date).to_string());