mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 17:24:48 -05:00
Userland: Use Core::ArgsParser for 'modunload'
This commit is contained in:
parent
ca799fe4ab
commit
3cc5ed642e
Notes:
sideshowbarker
2024-07-19 04:11:49 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/3cc5ed642e9 Pull-request: https://github.com/SerenityOS/serenity/pull/3019
1 changed files with 7 additions and 5 deletions
|
@ -24,16 +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 name>\n", argv[0]);
|
||||
return 0;
|
||||
}
|
||||
const char* name = argv[1];
|
||||
const char* name = nullptr;
|
||||
|
||||
Core::ArgsParser args_parser;
|
||||
args_parser.add_positional_argument(name, "Name of the module to unload", "name");
|
||||
args_parser.parse(argc, argv);
|
||||
|
||||
int rc = module_unload(name, strlen(name));
|
||||
if (rc < 0) {
|
||||
perror("module_unload");
|
||||
|
|
Loading…
Reference in a new issue