File tree Expand file tree Collapse file tree 1 file changed +68
-0
lines changed
Expand file tree Collapse file tree 1 file changed +68
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -e
3+ eval " $( $( dirname $0 ) /adr-config) "
4+
5+ # # usage: adr generate table [-i INTRO] [-o OUTRO] [-p LINK_PREFIX]
6+ # #
7+ # # Generates a table in Markdown format to stdout that contains the ADR name
8+ # # and status.
9+ # #
10+ # # Options:
11+ # #
12+ # # -i INTRO precede the table with the given INTRO text.
13+ # # -o OUTRO follow the table with the given OUTRO text.
14+ # # -p LINK_PREFIX
15+ # # prefix each decision file link with LINK_PREFIX.
16+ # #
17+ # # Both INTRO and OUTRO must be in Markdown format.
18+
19+ args=$( getopt i:o:p: $* )
20+ set -- $args
21+
22+ link_prefix=
23+
24+ for arg
25+ do
26+ case " $arg "
27+ in
28+ -i)
29+ intro=" $2 "
30+ shift 2
31+ ;;
32+ -o)
33+ outro=" $2 "
34+ shift 2
35+ ;;
36+ -p)
37+ link_prefix=" $2 "
38+ shift 2
39+ ;;
40+ --)
41+ shift
42+ break
43+ ;;
44+ esac
45+ done
46+
47+ if [ ! -z $intro ]
48+ then
49+ cat " $intro "
50+ echo
51+ fi
52+
53+ echo " |ADR|Status|"
54+ echo " |---|---|"
55+ for f in $( " $adr_bin_dir /adr-list" )
56+ do
57+ title=$( " $adr_bin_dir /_adr_title" $f )
58+ link=${link_prefix} $( basename $f )
59+ status=$( " $adr_bin_dir /_adr_status" $f )
60+
61+ echo " |[$title ]($link )|$status |"
62+ done
63+
64+ if [ ! -z $outro ]
65+ then
66+ echo
67+ cat " $outro "
68+ fi
You can’t perform that action at this time.
0 commit comments