The checking program answers the seat list of the heads laid for it (issue 1921)
Asked -seats, it reads every seat definition the heads carry, resolves the parts it includes and answers the list with what it left out and why, so the running checker hands the manifest validator and the composer a list it does not read itself (ADR 0636 §4, ADR 0644 §1). Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i
This commit is contained in:
@@ -28,6 +28,7 @@ func run(args []string, getenv func(string) string, stdout, stderr io.Writer) in
|
||||
fs := flag.NewFlagSet("mesh-checking-program", flag.ContinueOnError)
|
||||
fs.SetOutput(stderr)
|
||||
verdict := fs.Bool("verdict", false, "answer the verdict of the facts in the input")
|
||||
seats := fs.Bool("seats", false, "answer the seat list of the heads laid for it")
|
||||
if err := fs.Parse(args); err != nil {
|
||||
return 2
|
||||
}
|
||||
@@ -35,8 +36,24 @@ func run(args []string, getenv func(string) string, stdout, stderr io.Writer) in
|
||||
fmt.Fprintf(stderr, "mesh-checking-program: "+format+"\n", a...)
|
||||
return 2
|
||||
}
|
||||
if *seats {
|
||||
dir := getenv(delivery.RunHeadsEnv)
|
||||
if dir == "" {
|
||||
return refuse("no heads: %s names no directory", delivery.RunHeadsEnv)
|
||||
}
|
||||
answer, err := rules.SeatsOf(os.DirFS(dir))
|
||||
if err != nil {
|
||||
return refuse("%v", err)
|
||||
}
|
||||
line, err := json.Marshal(answer)
|
||||
if err != nil {
|
||||
return refuse("the seat list cannot be written: %v", err)
|
||||
}
|
||||
fmt.Fprintf(stdout, "%s\n", line)
|
||||
return 0
|
||||
}
|
||||
if !*verdict {
|
||||
return refuse("nothing asked: give -verdict")
|
||||
return refuse("nothing asked: give -verdict or -seats")
|
||||
}
|
||||
file := getenv(delivery.RunInputEnv)
|
||||
if file == "" {
|
||||
|
||||
Reference in New Issue
Block a user