cat-file: make the options mutually exclusive
commitb48158ac94cf725834b70b4a5ab7f2d152a741d4
authorKarthik Nayak <karthik.188@gmail.com>
Sun, 3 May 2015 14:30:00 +0000 (3 20:00 +0530)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 May 2015 20:35:48 +0000 (6 13:35 -0700)
tree3ab282155912445dc9136345d661d441b3f94131
parent46f034483eb9f88cf79cba8b76f085464287fc58
cat-file: make the options mutually exclusive

We only parse the options if 2 or 3 arguments are specified.
Update 'struct option options[]' to use OPT_CMDMODE rather than
OPT_SET_INT to allow only one mutually exclusive option and avoid the
need for checking number of arguments. This was written by Junio C Hamano,
tested by me.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/cat-file.c