harn-stdlib 0.10.193

Embedded Harn standard library source catalog
Documentation
/** Generated by scripts/generate_cli_localization.mjs. Do not edit. */
import { MESSAGE_56 } from "std/cli/localization/messages/part_11"
import { MESSAGE_70 } from "std/cli/localization/messages/part_14"
import { MESSAGE_75 } from "std/cli/localization/messages/part_15"
import { MESSAGE_109 } from "std/cli/localization/messages/part_21"
import { MESSAGE_114 } from "std/cli/localization/messages/part_22"
import { MESSAGE_165, MESSAGE_166, MESSAGE_167 } from "std/cli/localization/messages/part_33"
import { MESSAGE_170 } from "std/cli/localization/messages/part_34"
import {
  MESSAGE_180,
  MESSAGE_181,
  MESSAGE_182,
  MESSAGE_183,
} from "std/cli/localization/messages/part_36"
import { MESSAGE_192 } from "std/cli/localization/messages/part_38"
import { MESSAGE_220 } from "std/cli/localization/messages/part_44"
import { MESSAGE_226 } from "std/cli/localization/messages/part_45"
import { MESSAGE_230 } from "std/cli/localization/messages/part_46"
import { MESSAGE_240 } from "std/cli/localization/messages/part_48"
import { MESSAGE_253 } from "std/cli/localization/messages/part_50"
import { MESSAGE_293 } from "std/cli/localization/messages/part_58"
import { MessageTemplate, render_message } from "std/cli/message_template"

const MESSAGES: dict<string, MessageTemplate> = {
  "  groups: {0}": MESSAGE_56,
  "  jobs: {0}": MESSAGE_70,
  "  manifest sha256: {0}": MESSAGE_75,
  "  receipt sha256: {0}": MESSAGE_109,
  "  requests: {0}": MESSAGE_114,
  "  {0}  {1}/{2}  discount {3}  turnaround {4}  {5}": MESSAGE_165,
  "  {0} {1}/{2} {3} requests={4}": MESSAGE_166,
  "  {0} {1}/{2} {3} requests={4} file={5}": MESSAGE_167,
  "(no batch-capable models match)": MESSAGE_170,
  "Batch manifest failed": MESSAGE_180,
  "Batch manifest written: {0}": MESSAGE_181,
  "Batch prepare failed": MESSAGE_182,
  "Batch prepare receipt written: {0}": MESSAGE_183,
  "Batch-capable models for {0}": MESSAGE_192,
  constraints: MESSAGE_220,
  "dry-run only": MESSAGE_226,
  errors: MESSAGE_230,
  "live submit": MESSAGE_240,
  "planner constraints": MESSAGE_253,
  warnings: MESSAGE_293,
}

/**
 * Select a registered CLI template without interpreting argument text.
 * @effects: []
 * @errors: ["Unregistered CLI localization message", "CLI localization argument count does not match its registered template"]
 */
pub fn cli_message(locale: string, source: string, values: list<string>) -> string {
  const template = MESSAGES[source]
  guard template != nil else {
    throw "Unregistered CLI localization message"
  }
  return render_message(template, locale, values)
}