From 2a78d1909ba7ccecad6e07a4b988eb77d4385359 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 9 Sep 2022 10:09:40 +0300 Subject: fix: use new Subplot external metadata Sponsored-by: author --- check | 31 ++++++++++++++----------------- vmadm.md | 16 ---------------- vmadm.subplot | 15 +++++++++++++++ 3 files changed, 29 insertions(+), 33 deletions(-) create mode 100644 vmadm.subplot diff --git a/check b/check index 0e48419..a6018e3 100755 --- a/check +++ b/check @@ -5,27 +5,24 @@ set -eu hideok=chronic -if [ "$#" -gt 0 ] -then - case "$1" in +if [ "$#" -gt 0 ]; then + case "$1" in verbose | -v | --verbose) - hideok= - shift - ;; - esac + hideok= + shift + ;; + esac fi -if [ "$#" = 0 ] -then - echo "MUST give path to base image for testing" 1>&2 - exit 1 +if [ "$#" = 0 ]; then + echo "MUST give path to base image for testing" 1>&2 + exit 1 fi base_image="$1" shift -got_cargo_cmd() -{ - cargo --list | grep " $1 " > /dev/null +got_cargo_cmd() { + cargo --list | grep " $1 " >/dev/null } $hideok cargo build --all-targets @@ -33,10 +30,10 @@ got_cargo_cmd clippy && cargo clippy -q got_cargo_cmd fmt && $hideok cargo fmt -- --check $hideok cargo test -subplot docgen vmadm.md -o vmadm.html -subplot docgen vmadm.md -o vmadm.pdf +subplot docgen vmadm.subplot -o vmadm.html +subplot docgen vmadm.subplot -o vmadm.pdf -subplot codegen vmadm.md -o test.py +subplot codegen vmadm.subplot -o test.py rm -f test.log $hideok python3 test.py --log test.log --env="BASE_IMAGE=$base_image" "$@" diff --git a/vmadm.md b/vmadm.md index e24e0db..7d5ae96 100644 --- a/vmadm.md +++ b/vmadm.md @@ -1,19 +1,3 @@ ---- -title: "vmadm – virtual machine administration" -author: "Lars Wirzenius" -bindings: - - subplot/vmadm.yaml - - lib/files.yaml - - lib/runcmd.yaml -impls: - python: - - subplot/vmadm.py - - lib/files.py - - lib/runcmd.py -classes: -- json -... - # Data files for scenarios This section has some data files used by scenarios. diff --git a/vmadm.subplot b/vmadm.subplot new file mode 100644 index 0000000..ef76a9e --- /dev/null +++ b/vmadm.subplot @@ -0,0 +1,15 @@ +title: "vmadm – virtual machine administration" +author: "Lars Wirzenius" +markdowns: + - vmadm.md +bindings: + - subplot/vmadm.yaml + - lib/files.yaml + - lib/runcmd.yaml +impls: + python: + - subplot/vmadm.py + - lib/files.py + - lib/runcmd.py +classes: +- json -- cgit v1.2.1