diff options
author | Linus Groh <mail@linusgroh.de> | 2020-08-05 21:00:18 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-06 20:41:13 +0200 |
commit | f6369a66b19b72bd7bfd8cb532c0669817d6b6e8 (patch) | |
tree | aeca27902f34612ad1cefa284a403b026d9b9482 /Userland/modload.cpp | |
parent | 3cc5ed642e91797c6767648f926c2961b0f1a924 (diff) | |
download | serenity-f6369a66b19b72bd7bfd8cb532c0669817d6b6e8.zip |
Userland: Use Core::ArgsParser for 'modload'
Diffstat (limited to 'Userland/modload.cpp')
-rw-r--r-- | Userland/modload.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Userland/modload.cpp b/Userland/modload.cpp index b5d66a357a..da86c93af4 100644 --- a/Userland/modload.cpp +++ b/Userland/modload.cpp @@ -24,17 +24,18 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <LibCore/ArgsParser.h> #include <serenity.h> #include <string.h> int main(int argc, char** argv) { - if (argc != 2) { - printf("usage: %s <module.o>\n", argv[0]); - return 0; - } + const char* path = nullptr; + + Core::ArgsParser args_parser; + args_parser.add_positional_argument(path, "Path to the module to load", "path"); + args_parser.parse(argc, argv); - const char* path = argv[1]; int rc = module_load(path, strlen(path)); if (rc < 0) { perror("module_load"); |