diff options
-rw-r--r-- | lib/command.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/command.h b/lib/command.h index fd55f2d5..6a20e232 100644 --- a/lib/command.h +++ b/lib/command.h @@ -459,6 +459,17 @@ struct cmd_token #endif /* VTYSH_EXTRACT_PL */ +/* + * Sometimes #defines create maximum values that + * need to have strings created from them that + * allow the parser to match against them. + * These macros allow that. + */ +#define CMD_CREATE_STR(s) CMD_CREATE_STR_HELPER(s) +#define CMD_CREATE_STR_HELPER(s) #s +#define CMD_RANGE_STR(a,s) "<" CMD_CREATE_STR(a) "-" CMD_CREATE_STR(s) ">" + + /* Common descriptions. */ #define SHOW_STR "Show running system information\n" #define IP_STR "IP information\n" |