From 672accd1d4c36e07091678997dbfcd1a0a02b104 Mon Sep 17 00:00:00 2001 From: Kai Polaschek-Rausch <145326953+kpolaschekrausch@users.noreply.github.com> Date: Fri, 1 Mar 2024 12:14:23 +0100 Subject: [PATCH 1/2] Add script for generating table with ADR name and status --- src/_adr_generate_table | 72 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 src/_adr_generate_table diff --git a/src/_adr_generate_table b/src/_adr_generate_table new file mode 100644 index 0000000..92c94aa --- /dev/null +++ b/src/_adr_generate_table @@ -0,0 +1,72 @@ +#!/bin/bash +set -e +eval "$($(dirname $0)/adr-config)" + +## usage: adr generate table [-i INTRO] [-o OUTRO] [-p LINK_PREFIX] +## +## Generates a table in Markdown format to stdout that contains the ADR name and status. +## +## Options: +## +## -i INTRO precede the table of contents with the given INTRO text. +## -o OUTRO follow the table of contents with the given OUTRO text. +## -p LINK_PREFIX +## prefix each decision file link with LINK_PREFIX. +## +## Both INTRO and OUTRO must be in Markdown format. + +args=$(getopt i:o:p: $*) +set -- $args + +link_prefix= + +for arg +do + case "$arg" + in + -i) + intro="$2" + shift 2 + ;; + -o) + outro="$2" + shift 2 + ;; + -p) + link_prefix="$2" + shift 2 + ;; + --) + shift + break + ;; + esac +done + +if [ ! -z $intro ] +then + cat "$intro" + echo +fi + +cat < Date: Fri, 1 Mar 2024 12:16:05 +0100 Subject: [PATCH 2/2] Update _adr_generate_table --- src/_adr_generate_table | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/_adr_generate_table b/src/_adr_generate_table index 92c94aa..01ca894 100644 --- a/src/_adr_generate_table +++ b/src/_adr_generate_table @@ -8,8 +8,8 @@ eval "$($(dirname $0)/adr-config)" ## ## Options: ## -## -i INTRO precede the table of contents with the given INTRO text. -## -o OUTRO follow the table of contents with the given OUTRO text. +## -i INTRO precede the table with the given INTRO text. +## -o OUTRO follow the table with the given OUTRO text. ## -p LINK_PREFIX ## prefix each decision file link with LINK_PREFIX. ## @@ -49,11 +49,6 @@ then echo fi -cat <