{{ $cli := site.Data.docs.cli }}

{{ $cli.name }}

The root command (no subcommand) starts Vector.

{{ highlight "vector [FLAGS] [OPTIONS] [SUBCOMMAND] [ARGS]" "shell" "" }}
{{ template "options-table" (dict "title" "Flags" "items" $cli.flags "cmd" "vector") }}
{{ template "options-table" (dict "title" "Options" "items" $cli.options "cmd" "vector") }}
{{ range $k, $v := $cli.commands }}
{{ partial "heading.html" (dict "text" (printf "vector %s" $k) "level" 3 "mono" true "id" $k) }}
{{ with $v.description }}
{{ . | markdownify }}
{{ end }}
{{ template "usage" $v }}
{{ with $v.example }}
{{ partial "heading.html" (dict "text" "Example" "level" 4 "toc_hide" true) }}
{{ highlight . "shell" "" }}
{{ end }} {{ with $v.flags }}
{{ template "options-table" (dict "title" "Flags" "items" . "cmd" $k) }}
{{ end }} {{ with $v.options }}
{{ template "options-table" (dict "title" "Options" "items" . "cmd" $k) }}
{{ end }} {{ with $v.args }}
{{ template "args-table" (dict "title" "Arguments" "items" . "cmd" $k) }}
{{ end }}
{{ end }}
{{ define "usage" }} {{ $s := printf "vector %s" .name }} {{ if .flags }} {{ $s = printf "%s [FLAGS]" $s }} {{ end }} {{ if .options }} {{ $s = printf "%s [OPTIONS]" $s }} {{ end }} {{ if .args }} {{ $s = printf "%s [ARGUMENTS]" $s }} {{ end }} {{ highlight $s "shell" "" }} {{ end }} {{ define "args-table" }} {{ range $k, $v := .items }} {{ end }}
{{ .title }} Required Description Type Default
{{ $k }} {{ $v.required }} {{ $v.description | markdownify }} {{ $v.type }} {{ with $v.default }} {{ . }} {{ else }} none {{ end }}
{{ end }} {{ define "options-table" }} {{ $cmd := .cmd }} {{ range .items }} {{ if .flag }} {{ $id := substr .flag 2 }} {{ $href := printf "%s-%s" $cmd $id }} {{ $comma := and .flag .short }} {{ end }} {{ if .option }} {{ $id := substr .option 2 }} {{ $href := printf "%s-%s" $cmd $id }} {{ $comma := and .option .short }} {{ end }} {{ end }}
{{ .title }} Description Environment variable Default
{{- .flag -}} {{ if $comma }},
{{ end }} {{ with .short }} {{ . }} {{ end }}
{{- .option -}} {{ if $comma }},
{{ end }} {{ with .short }} {{ . }} {{ end }}
{{ .description | markdownify }}
{{ with .enum }}
Enum options {{ range $k, $v := . }} {{ end }}
Option Description
{{ $k }} {{ $v }}
{{ end }}
{{ with .env_var }} {{ . }} {{ end }} {{ .default }}
{{ end }}