summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-05-08 10:37:33 +0300
committerLars Wirzenius <liw@liw.fi>2020-05-08 11:01:18 +0300
commit91cff65b5a5421ce6011909fe61df45dea1c99fd (patch)
treed0e26f10f3022751494f71f31742436ce23567f0 /templates
parentbad0209b1a9df569fddb99b22aae631860e32067 (diff)
downloadsubplot-91cff65b5a5421ce6011909fe61df45dea1c99fd.tar.gz
Change: bash template to run only requested scenarios
Diffstat (limited to 'templates')
-rw-r--r--templates/bash/template.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/templates/bash/template.sh b/templates/bash/template.sh
index 2466b69..c0a6e7e 100644
--- a/templates/bash/template.sh
+++ b/templates/bash/template.sh
@@ -195,9 +195,23 @@ scenario_{{ loop.index }}() {
#############################################################################
# Run the scenarios.
+if [ "$#" = 0 ]
+then {% for scenario in scenarios %}
+ scenario_{{ loop.index }}{% endfor %}
+else
+
+
+ for pattern in "$@"
+ do
+ pattern="$(echo "$pattern" | tr A-Z a-z)"
{% for scenario in scenarios %}
-scenario_{{ loop.index }}
+ if echo "{{ scenario.title | lower }}" | grep -F -e "$pattern" > /dev/null
+ then
+ scenario_{{ loop.index }}
+ fi
{% endfor %}
+ done
+fi
#############################################################################