Change how to identify custom comamnd (#6187)

Co-authored-by: Frank <v-frankz@microsoft.com>
This commit is contained in:
Kangaxx-0
2022-08-02 16:40:07 -07:00
committed by GitHub
parent ce6df93d05
commit ebf845f431
5 changed files with 19 additions and 5 deletions

View File

@ -37,6 +37,16 @@ pub trait Command: Send + Sync + CommandClone {
false
}
// This is an enhanced method to determine if a command is custom command or not
// since extern "foo" [] and def "foo" [] behaves differently
fn is_custom_command(&self) -> bool {
if self.get_block_id().is_some() {
true
} else {
self.is_known_external()
}
}
// Is a sub command
fn is_sub(&self) -> bool {
self.name().contains(' ')