summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorTyler Murphy <tylerm@tylerm.dev>2023-05-04 12:24:47 -0400
committerTyler Murphy <tylerm@tylerm.dev>2023-05-04 12:24:47 -0400
commitbd471562c72035d588b78e3c80c9eb0e9a9c18ec (patch)
tree5728bcfcbd81fac687d33d423c83d76ab6809b3e /src/main.c
parenti cant spell (diff)
downloadlazysphere-bd471562c72035d588b78e3c80c9eb0e9a9c18ec.tar.gz
lazysphere-bd471562c72035d588b78e3c80c9eb0e9a9c18ec.tar.bz2
lazysphere-bd471562c72035d588b78e3c80c9eb0e9a9c18ec.zip
grep
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index e23b915..c5943f0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -12,7 +12,6 @@ char* cmd;
int main (ARGUMENTS) {
if (argc < 1) {
- fprintf(stderr, "fatal: argument 0 missing");
return EXIT_FAILURE;
}
@@ -24,7 +23,7 @@ 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, xargs, tac, rm, cp, mkdir, mv\n");
+ printf("\tdd, cat, yes, echo, printf, id, groups, ls, tail, head, ed, tee, true, false, tee, whoami, wc, xargs, tac, rm, cp, mkdir, mv, grep\n");
return EXIT_SUCCESS;
}
argc--;
@@ -84,8 +83,10 @@ int main (ARGUMENTS) {
return makedir(NEXT_ARGS);
} else if (streql(cmd, "mv")) {
return mv(NEXT_ARGS);
+ } else if (streql(cmd, "grep")) {
+ return grep(NEXT_ARGS);
} else {
- fprintf(stderr, "lazysphere: invalid command %s", cmd);
+ fprintf(stderr, "lazysphere: invalid command %s\n", cmd);
return EXIT_FAILURE;
}