Hi Anurag,

On Tue, 2008-07-08 at 13:47 -0400, Anurag S. Maskey wrote:
> Taking the suggestions of this thread into account, I've made the
> changes to usr/src/cmd/dladm/dladm.c.  The webrev is at
> http://cr.opensolaris.org/~anurag_m/CR-6620534/ for codereview.

General comment: You can simplify this code and remove ~100 new lines by
taking advantage of the existing cmd_t table at 321.  Instead of having
#defines for all subcommands with a large switch statement in
command_usage(), you could simply place the usage strings in the table
and get rid of command_usage() entirely.  You can also place a dummy
entry at the end of the table to denote the end so that you can iterate
through it without needing a "MAX" value in usage().  You could pass in
usage strings from the table to the individual do_*() functions as an
argument so that they can print their own usage.

-Seb


_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to