From ec5b4e484e4b3a2cae1f855d6096a9cbdfa26dbb Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 2 Oct 2017 12:27:10 -0700 Subject: [PATCH] Add new "archNamespace" template function for parsing "--arch-namespace" parameters Example usage: `{{ archNamespace "windows-amd64" }}` => `winamd64` This is intended for use in https://github.com/docker-library/docs to help create a list of "Supported architectures" for each image which links to each supported architecture repository (and if supported by Bashbrew itself, allows us to keep https://github.com/docker-library/docs isolated from Jenkins assumptions while still allowing Jenkins to contain the single-source-of-truth for arch-to-namespace mappings). --- go/src/bashbrew/cmd-cat.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/go/src/bashbrew/cmd-cat.go b/go/src/bashbrew/cmd-cat.go index 4664be1..e3c5c9d 100644 --- a/go/src/bashbrew/cmd-cat.go +++ b/go/src/bashbrew/cmd-cat.go @@ -45,6 +45,9 @@ func cmdCat(c *cli.Context) error { "arch": func() string { return arch }, + "archNamespace": func(arch string) string { + return archNamespaces[arch] + }, }).Parse(format) if err != nil { return cli.NewMultiError(tmplMultiErr, err)