vzctl: fix unrecognized option reporting
Apparently glibc's getopt_long() uses argv[0] when reporting option parsing
errors. Since we play with argv/argc in main(), argv[0] becomes CTID, which
doesn't make sense. After we parsed CTID, we can reset argv[0] to be original
argv[0], ie the name of the executable.
Before this patch:
# vzctl set 101 --some
101: unrecognized option `--some'
After:
# vzctl set 101 --some
vzctl: unrecognized option `--some'
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
1 file changed