there would be a loop through the keys of %custom_regexes testing each
key (regex) against the $file string. The loop would stop on the first
match (it should be documented whether it is the numbers of CUSTOMN_REGEX that determine priority or the order that they are given in the config file) and use
the value of %custom_regexes for the key that matched, which is the command.
Currently taskopen only allows for two custom commands. Allowing for more custom commands would make taskopen more flexible.
Here is an idea for the design of the implementation:
Loop through the keys in the %config hash and find keys that match the following regex:
Then create another hash called %custom_regexes where as the key you store the regex and as the value the command.
Then in your
create_cmd()
instead ofthere would be a loop through the keys of %custom_regexes testing each key (regex) against the $file string. The loop would stop on the first match (it should be documented whether it is the numbers of CUSTOMN_REGEX that determine priority or the order that they are given in the config file) and use the value of %custom_regexes for the key that matched, which is the command.