summaryrefslogtreecommitdiffhomepage
path: root/public/tools/open/src/CommandLine.cc
diff options
context:
space:
mode:
authorAmlal <amlal@nekernel.org>2025-04-25 13:08:33 +0200
committerAmlal <amlal@nekernel.org>2025-04-25 13:08:33 +0200
commitfb790b07aeba8e22e4190cf3e1834d11ecde6c96 (patch)
tree4cec7d1b321307b1d5935577631dae116a658a37 /public/tools/open/src/CommandLine.cc
parent63a2d92c5dfe976175cda024ec01905d11b43738 (diff)
dev: better .clang-format, ran format command.
Signed-off-by: Amlal <amlal@nekernel.org>
Diffstat (limited to 'public/tools/open/src/CommandLine.cc')
-rw-r--r--public/tools/open/src/CommandLine.cc52
1 files changed, 25 insertions, 27 deletions
diff --git a/public/tools/open/src/CommandLine.cc b/public/tools/open/src/CommandLine.cc
index b3779c71..f2378599 100644
--- a/public/tools/open/src/CommandLine.cc
+++ b/public/tools/open/src/CommandLine.cc
@@ -9,41 +9,39 @@
/// @brief This program opens an application from **OPEN_APP_BASE_PATH**
/// @file CommandLine.cc
-#define OPEN_APP_APP_FLAG "-a"
+#define OPEN_APP_APP_FLAG "-a"
#define OPEN_APP_HELP_FLAG "-h"
#define OPEN_APP_BASE_PATH "/app/"
-SInt32 _NeMain(SInt32 argc, Char* argv[])
-{
- if (argc == 1)
- return EXIT_FAILURE;
+SInt32 _NeMain(SInt32 argc, Char* argv[]) {
+ if (argc == 1) return EXIT_FAILURE;
- PrintOut(nullptr, "open: Open Loader.\n");
- PrintOut(nullptr, "open: © 2024-2025 Amlal El Mahrouss, All rights reserved.\n");
+ PrintOut(nullptr, "open: Open Loader.\n");
+ PrintOut(nullptr, "open: © 2024-2025 Amlal El Mahrouss, All rights reserved.\n");
- for (SInt32 i = 1U; i < argc; ++i)
- {
- if (MmStrCmp(argv[i], OPEN_APP_HELP_FLAG) == 0)
- {
- PrintOut(nullptr, "open: %s: Application is being taken as the input (opens a PEF/PE32+ program depending on the CPU architecture).\n", OPEN_APP_APP_FLAG);
+ for (SInt32 i = 1U; i < argc; ++i) {
+ if (MmStrCmp(argv[i], OPEN_APP_HELP_FLAG) == 0) {
+ PrintOut(nullptr,
+ "open: %s: Application is being taken as the input (opens a PEF/PE32+ program "
+ "depending on the CPU architecture).\n",
+ OPEN_APP_APP_FLAG);
- return EXIT_SUCCESS;
- }
- else if (MmStrCmp(argv[i], OPEN_APP_APP_FLAG) == 0)
- {
- if ((i + 1) == argc)
- return EXIT_FAILURE;
- else if ((i + 2) == argc)
- return EXIT_FAILURE;
+ return EXIT_SUCCESS;
+ } else if (MmStrCmp(argv[i], OPEN_APP_APP_FLAG) == 0) {
+ if ((i + 1) == argc)
+ return EXIT_FAILURE;
+ else if ((i + 2) == argc)
+ return EXIT_FAILURE;
- Char base_path[FILE_MAX_LEN] = OPEN_APP_BASE_PATH;
- MmCopyMemory(base_path + MmStrLen(OPEN_APP_BASE_PATH), argv[i + 1], MmStrLen(argv[i + 1]));
+ Char base_path[FILE_MAX_LEN] = OPEN_APP_BASE_PATH;
+ MmCopyMemory(base_path + MmStrLen(OPEN_APP_BASE_PATH), argv[i + 1], MmStrLen(argv[i + 1]));
- UIntPtr ret = RtlSpawnProcess(StrFmt("{}/dist/{]}", base_path, argv[i + 2]), 0, nullptr, nullptr, 0);
+ UIntPtr ret =
+ RtlSpawnProcess(StrFmt("{}/dist/{]}", base_path, argv[i + 2]), 0, nullptr, nullptr, 0);
- return ret;
- }
- }
+ return ret;
+ }
+ }
- return EXIT_FAILURE;
+ return EXIT_FAILURE;
}