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/main.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/main.c')
-rw-r--r-- | src/main.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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); } |