examples/fips_validation: enhance getopt_long usage
authorIbtisam Tariq <ibtisam.tariq@emumba.com>
Thu, 4 Feb 2021 07:34:14 +0000 (07:34 +0000)
committerDavid Marchand <david.marchand@redhat.com>
Tue, 23 Mar 2021 11:48:11 +0000 (12:48 +0100)
commitfc6e6515c7a666475b8be1add18f49d10f255d66
treed28928e147a7a1fae0bad486897ef520efca510d
parent960f28b2a3b39c143191bd3a5424245fc7dc4cf8
examples/fips_validation: enhance getopt_long usage

Instead of using getopt_long return value, strcmp was used to
compare the input parameters with the struct option array. This
patch get rid of all those strcmp by directly binding each longopt
with an int enum. This is to improve readability and consistency in
all examples.

Bugzilla ID: 238

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ibtisam Tariq <ibtisam.tariq@emumba.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
examples/fips_validation/fips_validation.c
examples/fips_validation/fips_validation.h
examples/fips_validation/main.c