summaryrefslogtreecommitdiff
path: root/src/commands/whoami.c
diff options
context:
space:
mode:
authorTyler Murphy <tylerm@tylerm.dev>2023-05-01 18:43:32 -0400
committerTyler Murphy <tylerm@tylerm.dev>2023-05-01 18:43:32 -0400
commit82e55dde69dc89fdf06e751b75449f35836282a1 (patch)
tree29e49ae19cba7f6a7c2987c381ebe4b253edc053 /src/commands/whoami.c
parentmove back to c99 (diff)
downloadlazysphere-82e55dde69dc89fdf06e751b75449f35836282a1.tar.gz
lazysphere-82e55dde69dc89fdf06e751b75449f35836282a1.tar.bz2
lazysphere-82e55dde69dc89fdf06e751b75449f35836282a1.zip
refactor and xargs
Diffstat (limited to 'src/commands/whoami.c')
-rw-r--r--src/commands/whoami.c4
1 files changed, 2 insertions, 2 deletions
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 <pwd.h>
-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);