Ajout d'une méthode de création d'une commande
This commit is contained in:
parent
9a7da75ec8
commit
e9e1dbf6d8
@ -21,3 +21,14 @@ type RegexMatcher struct {
|
|||||||
func (m RegexMatcher) Match(data string) bool {
|
func (m RegexMatcher) Match(data string) bool {
|
||||||
return m.matcher.MatchString(data)
|
return m.matcher.MatchString(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Build Permet de construire une chaine respectant une commande. Retourne la chaine et bool (TRUE si correct et FALSE si incorrect)
|
||||||
|
func (m RegexMatcher) Build(cmd string, datas ...string) (string, bool) {
|
||||||
|
str := cmd
|
||||||
|
|
||||||
|
for _, data := range datas {
|
||||||
|
str += " " + data
|
||||||
|
}
|
||||||
|
|
||||||
|
return str, m.Match(str)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user