#!/usr/bin/env bashset -euo pipefail# cue.sh## SUMMARY## CUE utilities.ROOT=$(git rev-parse --show-toplevel)CUE_SOURCES="${ROOT}/website/cue"list-docs-files() {find "${CUE_SOURCES}" -name '*.cue'}cmd_list() {list-docs-files}cmd_fmt() {list-docs-files | xargs cue fmt "$@"}cmd_vet() {list-docs-files | xargs cue vet --concrete --all-errors "$@"}cmd_eval() {list-docs-files | xargs cue eval --concrete --all-errors "$@"}cmd_export() {list-docs-files | xargs cue export --all-errors "$@"}usage() {cat >&2 <<-EOFUsage: 0ドル MODEModes:list - list all the documentation filesfmt - format all the documentation filesvet - check the documentation files and print errorseval - print the evaluated documentation,optionally pass the expression to evaluate via "-e EXPRESSION"export - export the documentation,optionally pass the expression to evaluate via "-e EXPRESSION"Examples:Print the whole documentation in the JSON format:0ドル exportPrint the "components.sources.kubernetes_logs" subtree in CUE format:0ドル eval -e components.sources.kubernetes_logsPrint the "cli" subtree in JSON format:0ドル export -e cliEOFexit 1}MODE="${1:-}"case "$MODE" inlist|fmt|vet|eval|export)shift"cmd_$MODE" "$@";;*)usage;;esac
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。