]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
update the help of lxc-checkpoint and lxc-restart
authorMichel Normand <normand@fr.ibm.com>
Thu, 25 Jun 2009 09:10:39 +0000 (11:10 +0200)
committerDaniel Lezcano <dlezcano@fr.ibm.com>
Thu, 25 Jun 2009 09:10:39 +0000 (11:10 +0200)
Update the checkpoint and restart regarding the statefile parameter.

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
src/lxc/lxc_checkpoint.c
src/lxc/lxc_restart.c

index 0ca35fb934eee89cf3ecb7564400906520706944..2fe9f51da2241112786a4088fd15bc1f8b17aa7c 100644 (file)
@@ -62,15 +62,15 @@ static const struct option my_longopts[] = {
 static struct lxc_arguments my_args = {
        .progname = "lxc-checkpoint",
        .help     = "\
---name=NAME STATEFILE\n\
+--name=NAME --directory STATEFILE\n\
 \n\
-lxc-checkpoint checkpoints in STATEFILE file the NAME container\n\
+lxc-checkpoint checkpoints in STATEFILE the NAME container\n\
 \n\
 Options :\n\
   -n, --name=NAME      NAME for name of the container\n\
   -k, --kill           stop the container after checkpoint\n\
   -p, --pause          don't unfreeze the container after the checkpoint\n\
-  -d, --directory      directory to store the statefile\n",
+  -d, --directory=STATEFILE where to store the statefile\n",
 
        .options  = my_longopts,
        .parser   = my_parser,
index f8b4ce63c8b8e046571c8dca0cca483089107e78..9f4bb1dbc50109ea28dfb69a2a2428d1186d465f 100644 (file)
 
 static int my_checker(const struct lxc_arguments* args)
 {
-       if (!args->argc) {
-               lxc_error(args, "missing STATEFILE filename !");
+       if (!args->statefile) {
+               lxc_error(args, "no statefile specified");
                return -1;
        }
 
        return 0;
 }
 
+static int my_parser(struct lxc_arguments* args, int c, char* arg)
+{
+       switch (c) {
+       case 'd':
+               args->statefile = arg;
+               break;
+       }
+
+       return 0;
+}
+
 static const struct option my_longopts[] = {
+       {"directory", required_argument, 0, 'd'},
        LXC_COMMON_OPTIONS
 };
 
 static struct lxc_arguments my_args = {
        .progname = "lxc-restart",
        .help     = "\
---name=NAME STATEFILE\n\
+--name=NAME --directory STATEFILE\n\
 \n\
-lxc-restart restarts from STATEFILE file the NAME container\n\
+lxc-restart restarts from STATEFILE the NAME container\n\
 \n\
 Options :\n\
-  -n, --name=NAME      NAME for name of the container\n",
+  -n, --name=NAME           NAME for name of the container\n\
+  -d, --directory=STATEFILE for name of statefile\n",
        .options  = my_longopts,
-       .parser   = NULL,
+       .parser   = my_parser,
        .checker  = my_checker,
 };