changeset 16:d8ea207162ca

add box command, and box add, box list
author taiki
date Mon, 18 Nov 2013 03:50:20 -1000
parents f194adc597b6
children fb9f3738a8e6
files TODO ie-vagrant.c
diffstat 2 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/TODO	Tue Nov 12 01:50:50 2013 -1000
+++ b/TODO	Mon Nov 18 03:50:20 2013 -1000
@@ -1,8 +1,9 @@
-chown login users directory
+*chown login users directory
 mount .vagrant.d
 network configration
 
 *export VAGRANT_HOME=/root/.vagrant.d/
 *export VAGRANT_DEFAULT_PROVIDER=kvm
 
-list box for user understand users box 
+*list box for user understand users box 
+*add box for user understand users box 
--- a/ie-vagrant.c	Tue Nov 12 01:50:50 2013 -1000
+++ b/ie-vagrant.c	Mon Nov 18 03:50:20 2013 -1000
@@ -31,6 +31,11 @@
 #define up_command "up"
 #define destroy_command "destroy"
 #define ssh_command "ssh"
+#define box_command "box"
+
+#define box_add_command "add"
+#define box_list_command "list"
+
 #define provider_arg "--provider=kvm"
 
 #define NEW(type)  ((type*)malloc(sizeof(type)))
@@ -121,6 +126,16 @@
   if (execl(command, command, destroy_command, NULL) < 0) {
    perror("Execl:");
   }
+ } else if ( strncmp(argv[1], "box", 3) == 0 ) {
+    if ( strncmp(argv[2], "add", 3) == 0 ) {
+        if (execl(command, command, box_add_command, NULL) < 0) {
+            perror("Execl:");
+        }
+    } else if (strncmp(argv[2], "list", 4) == 0 ) {
+        if (execl(command, command, box_command, box_list_command, NULL) < 0) {
+            perror("Execl:");
+        }
+    }
  } else if ( strncmp(argv[1], "up", 2) == 0 ) {
   if (execl(command, command, up_command, provider_arg, NULL) < 0) {
    perror("Execl:");