cgpt: show: add some sanity checking to -i flags
If people use -i0, the code runs as if the flag wasn't specified.
Since valid partition numbers are [1,128], and the lower layers
already reject values outside that range (except for 0), add an
explicit check to the CLI for -i0.
Trying to display specific fields w/out -i makes no sense, and
the lower layers just ignore it. Add an explicit check for it
so users don't try to do `cgpt show /dev/sda -s` and wonder why
the output is unchanged.
Passing more than one specific field selector like -s -b doesn't
work -- whatever flag was specified last wins. This isn't that
obvious to users, so throw an explicit error when it happens.
Reviewed-by: Julius Werner <email@example.com>
Commit-Queue: Mike Frysinger <firstname.lastname@example.org>
Tested-by: Mike Frysinger <email@example.com>
1 file changed