mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Change -e
to use partial instead of exact match
Fixes https://gitlab.com/arctic-fox/spectator/-/issues/71 Fixes https://github.com/icy-arctic-fox/spectator/issues/45
This commit is contained in:
parent
17a3ca3ac7
commit
b5c61f9003
3 changed files with 5 additions and 2 deletions
|
@ -112,7 +112,7 @@ module Spectator
|
|||
# Adds the example filter option to the parser.
|
||||
private def example_option(parser, builder)
|
||||
parser.on("-e", "--example STRING", "Run examples whose full nested names include STRING") do |pattern|
|
||||
Log.debug { "Filtering for examples named '#{pattern}' (-e '#{pattern}')" }
|
||||
Log.debug { "Filtering for examples containing '#{pattern}' (-e '#{pattern}')" }
|
||||
filter = NameNodeFilter.new(pattern)
|
||||
builder.add_node_filter(filter)
|
||||
end
|
||||
|
|
|
@ -9,7 +9,7 @@ module Spectator
|
|||
|
||||
# Checks whether the node satisfies the filter.
|
||||
def includes?(node) : Bool
|
||||
@name == node.to_s
|
||||
node.to_s.includes?(@name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue