blob: 03dc5bfc1e0b798a2a7bd5e8f17c7d04aec3d36f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#!/bin/bash
requirements_dir="$(dirname $0)/.."
id="$1"
if [ "$id" == "" ]
then
echo "Usage: req get req-XXX, dml-XXX, ass-XXX, need-XXX."
exit 1
fi
if [[ "$id" =~ ^req-[0-9][0-9][0-9]$ ]]
then
cat "${requirements_dir}/catalogue/$id.md"
exit 0
fi
if [[ "$id" =~ ^dml-[0-9][0-9][0-9]$ ]]
then
cat "${requirements_dir}/data_models/$id.md"
exit 0
fi
if [[ "$id" =~ ^ass-[0-9][0-9][0-9]$ ]]
then
cat "${requirements_dir}/assumptions/$id.md"
exit 0
fi
if [[ "$id" =~ ^need-[0-9][0-9][0-9]$ ]]
then
cat "${requirements_dir}/needs/$id.md"
exit 0
fi
echo "$id is not a valid format. Try: req-XXX, dml-XXX, ass-XXX, need-XXX."
exit 1
|