From 0b7fd24bc79c791730126e6cd694092dd37b757d Mon Sep 17 00:00:00 2001 From: Itxaka Date: Thu, 11 May 2023 13:30:17 +0200 Subject: [PATCH] Allow overriding the schema version number (#19) --- main.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 9f17938..8192f15 100644 --- a/main.go +++ b/main.go @@ -464,9 +464,21 @@ The validate command expects a configuration file as its only argument. Local fi }, { Name: "print-schema", + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "version", + Usage: "Print the current schema but with another version number, instead of using the agent version number.", + }, + }, Action: func(c *cli.Context) error { + var version string + if c.String("version") != "" { + version = c.String("version") + } else { + version = common.VERSION + } - json, err := agent.JSONSchema(common.VERSION) + json, err := agent.JSONSchema(version) if err != nil { return err