From 82e55dde69dc89fdf06e751b75449f35836282a1 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Mon, 1 May 2023 18:43:32 -0400 Subject: refactor and xargs --- src/commands/whoami.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/commands/whoami.c') diff --git a/src/commands/whoami.c b/src/commands/whoami.c index f19a724..623a35a 100644 --- a/src/commands/whoami.c +++ b/src/commands/whoami.c @@ -2,14 +2,14 @@ #include -static void help() { +static void help(void) { printf("Usage: whoami\n\n"); printf("Print the username associated with the current effective user id\n"); exit(EXIT_SUCCESS); } COMMAND(whoami) { - if (argc > 0 && streql("--help", argv[0])) help(); + parse_help(argc, argv, help); uid_t usr = getuid(); struct passwd* passwd = getpwuid(usr); -- cgit v1.2.3-freya