mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 12:17:35 +00:00
Userland: Use Core::ArgsParser for 'modload'
This commit is contained in:
parent
3cc5ed642e
commit
f6369a66b1
1 changed files with 6 additions and 5 deletions
|
@ -24,17 +24,18 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <LibCore/ArgsParser.h>
|
||||||
#include <serenity.h>
|
#include <serenity.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
if (argc != 2) {
|
const char* path = nullptr;
|
||||||
printf("usage: %s <module.o>\n", argv[0]);
|
|
||||||
return 0;
|
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));
|
int rc = module_load(path, strlen(path));
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
perror("module_load");
|
perror("module_load");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue