criu: unify/improve bad argument messages
* Introduce a generic way to report that option argument is invalid * Switch to using it from existing places (options --veth-pair, --port, -n) * Check for invalid argument of -p and -t and report it. Notes: 1) In order to correctly print long option name in case it was used instead of a short one, I had to move "struct option long_opts" to main() context, this is why the patch is so long. 2) pr_msg() (rather than pr_err()) is used to print errors, otherwise it is prefixed with that (crtools.c:123) prefix which makes it look weird. 3) Usage is not shown in case of error, otherwise an error message is lost in output. Signed-off-by:Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
Showing
Please
register
or
sign in
to comment