Denis Fondras(open...@ledeuns.net) on 2017.07.26 18:42:13 +0200: > Hi, > > I use route(8) a lot and I thought being able to use shorter commands/keywords > could be nice. Like : > > route a default 192.0.2.1 > route del default > > Regards, > Denis
This will lead to usage and documentation issues (aside from your diff not including a manpage change): With your diff, someone might write somewhere just type "route a default 192.0.2.1" to configure a default route. Next we add a new keyword "abc"... (However, i have nothing against adding "del" as a synonym of "delete" to the keywords table) > Index: route.c > =================================================================== > RCS file: /cvs/src/sbin/route/route.c,v > retrieving revision 1.200 > diff -u -p -r1.200 route.c > --- route.c 23 Mar 2017 13:28:25 -0000 1.200 > +++ route.c 26 Jul 2017 16:34:43 -0000 > @@ -1864,7 +1864,10 @@ bprintf(FILE *fp, int b, char *s) > int > keycmp(const void *key, const void *kt) > { > - return (strcmp(key, ((struct keytab *)kt)->kt_cp)); > + size_t wordlen = 0; > + > + wordlen = strlen(key); > + return (strncmp(key, ((struct keytab *)kt)->kt_cp, wordlen)); > } > > int >