summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTyler Murphy <tylerm@tylerm.dev>2023-05-12 17:38:41 -0400
committerTyler Murphy <tylerm@tylerm.dev>2023-05-12 17:38:41 -0400
commitc6446e178bf8f4a53511e5ae1e0f3feeb921197c (patch)
treef13384c1d4f6f085d0856c253996c7b9000bcb7b /src
parentrefactor (diff)
downloadlazysphere-c6446e178bf8f4a53511e5ae1e0f3feeb921197c.tar.gz
lazysphere-c6446e178bf8f4a53511e5ae1e0f3feeb921197c.tar.bz2
lazysphere-c6446e178bf8f4a53511e5ae1e0f3feeb921197c.zip
chown, chmod
Diffstat (limited to '')
-rw-r--r--src/command.h2
-rw-r--r--src/main.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/src/command.h b/src/command.h
index 87cc749..fa8b00c 100644
--- a/src/command.h
+++ b/src/command.h
@@ -26,5 +26,7 @@ COMMAND(cp);
COMMAND(makedir);
COMMAND(mv);
COMMAND(grep);
+COMMAND(chown_cmd);
+COMMAND(chmod_cmd);
#endif
diff --git a/src/main.c b/src/main.c
index ad64b10..2718041 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,4 +1,5 @@
#include "command.h"
+#include "convert.h"
#include "lslib.h"
#include <stdlib.h>
@@ -22,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, grep\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, chown, chmod\n");
return EXIT_SUCCESS;
}
argc--;
@@ -84,6 +85,10 @@ int main (ARGUMENTS) {
return mv(NEXT_ARGS);
} else if (streql(cmd, "grep")) {
return grep(NEXT_ARGS);
+ } else if (streql(cmd, "chown")) {
+ return chown_cmd(NEXT_ARGS);
+ } else if (streql(cmd, "chmod")) {
+ return chmod_cmd(NEXT_ARGS);
} else {
fprintf(stderr, "lazysphere: invalid command %s\n", cmd);
return EXIT_FAILURE;