Back to Meshery

Mesheryctl Command Table

docs/layouts/shortcodes/mesheryctl-command-table.html

1.0.433.0 KB
Original Source

{{- $command_name := .Get "command" -}} {{- $commands := .Site.Data.mesheryctlcommands.cmds -}} {{- $command := index $commands $command_name -}}

CommandSubcommandFlagFunction
{{- if $command }} {{- if $command.name }}{{- $command_path := printf "reference/references/mesheryctl/%s" (cond (eq $command_name "global") "" $command_name) -}} {{- $command_page := site.GetPage $command_path -}} {{ if $command_page }}{{ $command.name }}{{ else }}{{ $command.name }}{{ end }}
{{- if $command.flags }} {{- range $key, $flag := $command.flags }}{{ $flag.name }}{{ $flag.description }}
{{- end }} {{- end }} {{- if $command.subcommands }} {{- range $subkey, $subcommand := $command.subcommands }}{{- $subcommand_path := printf "reference/references/mesheryctl/%s%s" (cond (eq $command_name "global") "" (printf "%s/" $command_name)) $subkey -}} {{- $subcommand_page := site.GetPage $subcommand_path -}} {{ if $subcommand_page }}{{ $subcommand.name }}{{ else }}{{ $subcommand.name }}{{ end }}{{ $subcommand.description }}
{{- if $subcommand.flags }} {{- range $flagkey, $flag := $subcommand.flags }}{{ $flag.name }}{{ $flag.description }}
{{- end }} {{- end }} {{- end }} {{- end }} {{- else }} {{- range $subkey, $subcommand := $command }} {{- $first := true }} {{- if $subcommand.flags }} {{- range $flagkey, $flag := $subcommand.flags }}{{- if $first }} {{- $subcommand_path := printf "reference/references/mesheryctl/%s/%s" $command_name $subkey -}} {{- $subcommand_page := site.GetPage $subcommand_path -}} {{ if $subcommand_page }}{{ $subcommand.name }}{{ else }}{{ $subcommand.name }}{{ end }}{{- $first = false }} {{- else }}{{- end }}
{{- end }} {{- end }} {{- if $subcommand.subcommands }} {{- range $subsubkey, $subsubcommand := $subcommand.subcommands }}{{- if $first }} {{- $subcommand_path := printf "reference/references/mesheryctl/%s/%s" $command_name $subkey -}} {{- $subcommand_page := site.GetPage $subcommand_path -}} {{ if $subcommand_page }}{{ $subcommand.name }}{{ else }}{{ $subcommand.name }}{{ end }}{{- $first = false }} {{- else }}{{- end }} {{- $subsubcommand_path := printf "reference/references/mesheryctl/%s/%s/%s" $command_name $subkey $subsubkey -}} {{- $subsubcommand_page := site.GetPage $subsubcommand_path -}} {{ if $subsubcommand_page }}{{ $subsubcommand.name }}{{ else }}{{ $subsubcommand.name }}{{ end }}
{{- if $subsubcommand.flags }} {{- range $flagkey, $flag := $subsubcommand.flags }}{{ $flag.name }}
{{- end }} {{- end }} {{- end }} {{- end }} {{- end }} {{- end }} {{- else }}Command "{{ $command_name }}" not found in data
{{- end }}