forked from Mirror/frr
lib, vtysh: re-add support for spaces in 'find'
Lost ability to handle them in the regex patch Signed-off-by: Quentin Young <qlyoung@nvidia.com>
This commit is contained in:
parent
c53b1ff198
commit
767f67a456
|
@ -2226,18 +2226,19 @@ DEFUN (no_banner_motd,
|
||||||
|
|
||||||
DEFUN(find,
|
DEFUN(find,
|
||||||
find_cmd,
|
find_cmd,
|
||||||
"find REGEX",
|
"find REGEX...",
|
||||||
"Find CLI command matching a regular expression\n"
|
"Find CLI command matching a regular expression\n"
|
||||||
"Search pattern (POSIX regex)\n")
|
"Search pattern (POSIX regex)\n")
|
||||||
{
|
{
|
||||||
char *pattern = argv[1]->arg;
|
|
||||||
const struct cmd_node *node;
|
const struct cmd_node *node;
|
||||||
const struct cmd_element *cli;
|
const struct cmd_element *cli;
|
||||||
vector clis;
|
vector clis;
|
||||||
|
|
||||||
regex_t exp = {};
|
regex_t exp = {};
|
||||||
|
|
||||||
|
char *pattern = argv_concat(argv, argc, 1);
|
||||||
int cr = regcomp(&exp, pattern, REG_NOSUB | REG_EXTENDED);
|
int cr = regcomp(&exp, pattern, REG_NOSUB | REG_EXTENDED);
|
||||||
|
XFREE(MTYPE_TMP, pattern);
|
||||||
|
|
||||||
if (cr != 0) {
|
if (cr != 0) {
|
||||||
switch (cr) {
|
switch (cr) {
|
||||||
|
|
|
@ -3719,19 +3719,19 @@ DEFUN (no_vtysh_output_file,
|
||||||
|
|
||||||
DEFUN(find,
|
DEFUN(find,
|
||||||
find_cmd,
|
find_cmd,
|
||||||
"find REGEX",
|
"find REGEX...",
|
||||||
"Find CLI command matching a regular expression\n"
|
"Find CLI command matching a regular expression\n"
|
||||||
"Search pattern (POSIX regex)\n")
|
"Search pattern (POSIX regex)\n")
|
||||||
{
|
{
|
||||||
char *pattern = argv[1]->arg;
|
|
||||||
const struct cmd_node *node;
|
const struct cmd_node *node;
|
||||||
const struct cmd_element *cli;
|
const struct cmd_element *cli;
|
||||||
vector clis;
|
vector clis;
|
||||||
|
|
||||||
regex_t exp = {};
|
regex_t exp = {};
|
||||||
|
char *pattern = argv_concat(argv, argc, 1);
|
||||||
int cr = regcomp(&exp, pattern, REG_NOSUB | REG_EXTENDED);
|
int cr = regcomp(&exp, pattern, REG_NOSUB | REG_EXTENDED);
|
||||||
|
|
||||||
|
XFREE(MTYPE_TMP, pattern);
|
||||||
|
|
||||||
if (cr != 0) {
|
if (cr != 0) {
|
||||||
switch (cr) {
|
switch (cr) {
|
||||||
case REG_BADBR:
|
case REG_BADBR:
|
||||||
|
|
Loading…
Reference in a new issue