summaryrefslogtreecommitdiff
path: root/argv.Match.go
diff options
context:
space:
mode:
Diffstat (limited to 'argv.Match.go')
-rw-r--r--argv.Match.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/argv.Match.go b/argv.Match.go
new file mode 100644
index 0000000..e9670a7
--- /dev/null
+++ b/argv.Match.go
@@ -0,0 +1,21 @@
+package argvpb
+
+import "strings"
+
+func (pb *Argv) IsMatch(match string) bool {
+ parts := strings.Split(match, ".")
+ pb.Debugf("IsMatch() parts (%v)", parts)
+ for _, part := range parts {
+ var found bool
+ for _, v := range pb.Real {
+ if part == v {
+ found = true
+ }
+ }
+ if found {
+ continue
+ }
+ return false
+ }
+ return true
+}