Unverified Commit 0bf1c308 by Serge Hallyn Committed by GitHub

Merge pull request #2114 from brauner/2018-01-27/make_name_arg_optional

tools: make "-n" optional
parents 2ddc6653 817a0e46
......@@ -256,10 +256,18 @@ extern int lxc_arguments_parse(struct lxc_arguments *args, int argc,
}
/* Check the command options */
if (!args->name && strcmp(args->progname, "lxc-autostart") != 0) {
lxc_error(args, "missing container name, use --name option");
return -1;
if (args->argv) {
args->name = argv[optind];
optind++;
args->argv = &argv[optind];
args->argc = argc - optind;
}
if (!args->name) {
lxc_error(args, "No container name specified");
return -1;
}
}
if (args->checker)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment