mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-10 22:30:21 +00:00
Merge pull request #2114 from brauner/2018-01-27/make_name_arg_optional
tools: make "-n" optional
This commit is contained in:
commit
0bf1c3082f
@ -256,10 +256,18 @@ extern int lxc_arguments_parse(struct lxc_arguments *args, int argc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check the command options */
|
/* Check the command options */
|
||||||
|
|
||||||
if (!args->name && strcmp(args->progname, "lxc-autostart") != 0) {
|
if (!args->name && strcmp(args->progname, "lxc-autostart") != 0) {
|
||||||
lxc_error(args, "missing container name, use --name option");
|
if (args->argv) {
|
||||||
return -1;
|
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)
|
if (args->checker)
|
||||||
|
Loading…
Reference in New Issue
Block a user