changeset 20:c908e2c7315d

WIP: run command
author atton
date Tue, 24 Nov 2015 17:31:55 +0900
parents fe7095c365cf
children 8a086917cf1a
files ie-docker.c
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ie-docker.c	Tue Nov 24 17:22:12 2015 +0900
+++ b/ie-docker.c	Tue Nov 24 17:31:55 2015 +0900
@@ -279,18 +279,19 @@
         exit(0);
     }
 
-    PSLISTPTR pslist = get_pslist(pattern);
-
     /*
      * Check argv for proper arguments and run
      * the corresponding script, if invoked.
      */
+    char *execl_command = malloc(sizeof(char) * 1024);
 
     if (command_is_matched(argv[1], ps_command)) {
-        printf("ps"); //TODO
-        print_pslist(pslist);
+        PSLISTPTR pslist = get_pslist(pattern);
+        print_pslist(pslist); // TODO check work correctly
     } else if (command_is_matched(argv[1], run_command)) {
-        printf("run"); // TODO
+        sprintf(execl_command, "%s %s %s --name %s %s %s",
+                base_exec_command, run_command, "-it -u 2015 ", name, "java-centos", "zsh");    //FIXME
+        printf(execl_command); // TODO
     } else if (command_is_matched(argv[1], start_command)) {
         printf("start"); // TODO
     } else if (command_is_matched(argv[1], stop_command)) {
@@ -305,6 +306,7 @@
         usage();
         return 0;
     }
+    free(execl_command);
     return 0;
 }