diff options
author | Tyler Murphy <tylerm@tylerm.dev> | 2023-05-01 18:43:32 -0400 |
---|---|---|
committer | Tyler Murphy <tylerm@tylerm.dev> | 2023-05-01 18:43:32 -0400 |
commit | 82e55dde69dc89fdf06e751b75449f35836282a1 (patch) | |
tree | 29e49ae19cba7f6a7c2987c381ebe4b253edc053 /src/commands/whoami.c | |
parent | move back to c99 (diff) | |
download | lazysphere-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.c | 4 |
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); |