summaryrefslogtreecommitdiff
path: root/src/main.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/main.c
parentmove back to c99 (diff)
downloadlazysphere-82e55dde69dc89fdf06e751b75449f35836282a1.tar.gz
lazysphere-82e55dde69dc89fdf06e751b75449f35836282a1.tar.bz2
lazysphere-82e55dde69dc89fdf06e751b75449f35836282a1.zip
refactor and xargs
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c6
1 files changed, 5 insertions, 1 deletions
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);
}