summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/main.c b/main.c
index 14c8861..63b1e3d 100644
--- a/main.c
+++ b/main.c
@@ -88,6 +88,21 @@ struct command split_command(char *input) {
return user_command;
}
+struct split_arg split_argument(struct command argument) {
+ struct split_arg new_argument = {};
+
+ char *source = strtok(argument.arg, " ");
+ char *destination = strtok(NULL, " ");
+
+ if (source != NULL) {
+ new_argument.source = source;
+ }
+ if (destination != NULL) {
+ new_argument.destination = destination;
+ }
+ return new_argument;
+}
+
void exec_command(char *input) {
const struct command user_command = split_command(input);