mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:17:45 +00:00
Userland: Use Core::ArgsParser for 'modunload'
This commit is contained in:
parent
ca799fe4ab
commit
3cc5ed642e
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…
Add table
Add a link
Reference in a new issue