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/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index d8ee1b4..35899e2 100644 --- a/src/main.c +++ b/src/main.c @@ -13,6 +13,7 @@ int main (ARGUMENTS) { error("error: argument 0 missing"); } +#ifdef CHECK_LINK struct stat buf; lstat(argv[0], &buf); @@ -20,12 +21,13 @@ int main (ARGUMENTS) { if (argc < 2) { printf("usage: lazysphere [function [arguments]...]\n\n"); printf("currently defined functions:\n"); - printf("\tdd, cat, yes, echo, printf, id, groups, ls, tail, head, ed, tee, true, false, tee, whoami, wc\n"); + printf("\tdd, cat, yes, echo, printf, id, groups, ls, tail, head, ed, tee, true, false, tee, whoami, wc, xargs\n"); return EXIT_SUCCESS; } argc--; argv = &argv[1]; } +#endif const char* cmd; if (strncmp("./", argv[0], 2) == 0) { @@ -66,6 +68,8 @@ int main (ARGUMENTS) { return whoami(NEXT_ARGS); } else if (streql(cmd, "wc")) { return wc(NEXT_ARGS); + } else if (streql(cmd, "xargs")) { + return xargs(NEXT_ARGS); } else { error("error: invalid command %s", cmd); } -- cgit v1.2.3-freya