stand: Add interp_has_builtin_cmd to see if we have a command
interp_has_builtin_cmd() will try to lookup the passed in command and returns true if it was found, false otherwise. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D36364
This commit is contained in:
parent
113dfadd5c
commit
a5948d40ad
@ -52,6 +52,7 @@ extern char command_errbuf[COMMAND_ERRBUFSZ];
|
||||
void interact(void);
|
||||
void interp_emit_prompt(void);
|
||||
int interp_builtin_cmd(int argc, char *argv[]);
|
||||
bool interp_has_builtin_cmd(const char *cmd);
|
||||
|
||||
/* Called by interp.c for interp_*.c embedded interpreters */
|
||||
int interp_include(const char *); /* Execute commands from filename */
|
||||
|
@ -190,3 +190,12 @@ interp_builtin_cmd(int argc, char *argv[])
|
||||
}
|
||||
return (result);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return true if the builtin command exists
|
||||
*/
|
||||
bool
|
||||
interp_has_builtin_cmd(const char *cmd)
|
||||
{
|
||||
return (interp_lookup_cmd(cmd) != NULL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user