• Kir Kolyshkin's avatar
    criu: unify/improve bad argument messages · 946a5852
    Kir Kolyshkin authored
    * 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: 's avatarKir Kolyshkin <kir@openvz.org>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    946a5852
crtools.c 11.9 KB