summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions.c40
-rw-r--r--actions.h10
2 files changed, 50 insertions, 0 deletions
diff --git a/actions.c b/actions.c
new file mode 100644
index 0000000..661587d
--- /dev/null
+++ b/actions.c
@@ -0,0 +1,40 @@
+#include "actions.h"
+
+void actions(char action)
+{
+ int os = detectOsType();
+ switch (action)
+ {
+ case 'c':
+ clean(os);
+ break;
+
+ case 'h':
+ help();
+ break;
+
+ case 'i':
+ installPackage(os);
+ break;
+
+ case 'q':
+ queryPackage(os);
+ break;
+
+ case 'r':
+ removePackage(os);
+ break;
+
+ case 's':
+ searchPackage(os);
+ break;
+
+ case 'u':
+ updatePackage(os);
+ break;
+
+ default:
+ puts("Command not found");
+ help();
+ }
+}
diff --git a/actions.h b/actions.h
new file mode 100644
index 0000000..7f25490
--- /dev/null
+++ b/actions.h
@@ -0,0 +1,10 @@
+#include "utils.h"
+
+void actions(char action);
+void clean(int os);
+void help();
+void installPackage(int os);
+void queryPackage(int os);
+void removePackage(int os);
+void searchPackage(int os);
+void updatePackage(int os);