Select the most current local schema version by name
This commit is contained in:
@@ -19,9 +19,9 @@ func run(args []string, stdout, stderr io.Writer) int {
|
||||
flags := flag.NewFlagSet("validate", flag.ContinueOnError)
|
||||
flags.SetOutput(stderr)
|
||||
root := flags.String("root", ".", "unpacked distribution root (contains catalog.json)")
|
||||
selection := flags.String("schema", "", "exact schema name@version from catalog.json")
|
||||
selection := flags.String("schema", "", "schema name; selects its highest local SemVer")
|
||||
flags.Usage = func() {
|
||||
fmt.Fprintln(stderr, "Usage: validate [-root DIRECTORY] -schema NAME@VERSION DOCUMENT...")
|
||||
fmt.Fprintln(stderr, "Usage: validate [-root DIRECTORY] -schema NAME DOCUMENT...")
|
||||
flags.PrintDefaults()
|
||||
}
|
||||
if err := flags.Parse(args); err != nil {
|
||||
@@ -62,7 +62,7 @@ func run(args []string, stdout, stderr io.Writer) int {
|
||||
status = 1
|
||||
continue
|
||||
}
|
||||
fmt.Fprintf(stdout, "%s: valid (%s; %s)\n", file, *selection, schema.Record.Contract)
|
||||
fmt.Fprintf(stdout, "%s: valid (%s@%s; %s)\n", file, schema.Record.Name, schema.Record.Version, schema.Record.Contract)
|
||||
}
|
||||
return status
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user