X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/e8840b36f349b0baa82cc64888e0c99f3614c8b9..de4636bb664106d9932ae7acb517e471b848f1f3:/uip/mhpath.c diff --git a/uip/mhpath.c b/uip/mhpath.c index bb77996c..ef16bce2 100644 --- a/uip/mhpath.c +++ b/uip/mhpath.c @@ -10,13 +10,17 @@ #include #include -static struct swit switches[] = { -#define VERSIONSW 0 - { "version", 0 }, -#define HELPSW 1 - { "help", 0 }, - { NULL, 0 } -}; +#define MHPATH_SWITCHES \ + X("version", 0, VERSIONSW) \ + X("help", 0, HELPSW) \ + +#define X(sw, minchars, id) id, +DEFINE_SWITCH_ENUM(MHPATH); +#undef X + +#define X(sw, minchars, id) { sw, minchars, id }, +DEFINE_SWITCH_ARRAY(MHPATH, switches); +#undef X int main(int argc, char **argv)