On 2/4/21 8:34 AM, Ibtisam Tariq wrote: > 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 > Cc: jiayu...@intel.com > Cc: huawei....@intel.com > > Reported-by: David Marchand <david.march...@redhat.com> > Signed-off-by: Ibtisam Tariq <ibtisam.ta...@emumba.com> > --- > v4: > * Set indentation of preprocessor directives. > * Add enums for OPT_BUILTIN_NET_DRIVER and OPT_CLIENT in getopt_long. > > v3: > * None. > > v2: > * Remove extra indentations. > * Remove extra block brackets in switch statement. > * Change enum names to start with OPT_ and remove KEYWORD from enum names. > > v1: > * enhance getopt_long usage. > --- > examples/vhost/main.c | 288 +++++++++++++++++++++++------------------- > 1 file changed, 155 insertions(+), 133 deletions(-) > Reviewed-by: Maxime Coquelin <maxime.coque...@redhat.com> Thanks, Maxime