Skip to content
Commit 946a5852 authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Pavel Emelyanov
Browse files

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: default avatarKir Kolyshkin <kir@openvz.org>
Signed-off-by: default avatarPavel Emelyanov <xemul@parallels.com>
parent 8c0feee2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment