mirror of
https://gitlab.com/psuapp/psu.git
synced 2024-08-30 18:12:34 +00:00
Update usage examples in commands with --format flag
This commit is contained in:
parent
933f73896b
commit
fb5bb20627
@ -19,6 +19,11 @@ var endpointGroupListCmd = &cobra.Command{
|
||||
Use: "list",
|
||||
Short: "List endpoint groups",
|
||||
Aliases: []string{"ls"},
|
||||
Example: ` Print endpoint groups in a table format:
|
||||
psu endpoint group ls
|
||||
|
||||
Print endpoint groups name and description:
|
||||
psu endpoint group ls --format "{{ .Name }}: {{ .Description }}"`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
client, err := common.GetClient()
|
||||
common.CheckError(err)
|
||||
|
@ -35,6 +35,11 @@ var endpointListCmd = &cobra.Command{
|
||||
Use: "list",
|
||||
Short: "List endpoints",
|
||||
Aliases: []string{"ls"},
|
||||
Example: ` Print endpoints in a table format:
|
||||
psu endpoint ls
|
||||
|
||||
Print whether an endpoint is a Swarm cluster or not:
|
||||
psu endpoint ls --format "{{ .Name }} ({{ .ID }}): {{ range .Snapshots }}{{ if .Swarm }}yes{{ else }}no{{ end }}{{ end }}"`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
client, err := common.GetClient()
|
||||
common.CheckError(err)
|
||||
|
@ -21,7 +21,14 @@ var stackListCmd = &cobra.Command{
|
||||
Use: "list",
|
||||
Short: "List stacks",
|
||||
Aliases: []string{"ls"},
|
||||
Example: "psu stack list --endpoint 1",
|
||||
Example: ` Print stacks in endpoint with ID=1 in a table format:
|
||||
psu stack ls --endpoint 1
|
||||
|
||||
Print names of stacks in endpoint with ID=1:
|
||||
psu stack ls --endpoint 1 --format "{{ .Name }}"
|
||||
|
||||
Print environment variables of stacks in endpoint with ID=1:
|
||||
psu stack ls --format "{{ .Name }}: {{ range .Env }}{{ .Name }}=\"{{ .Value }}\" {{ end }}"`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
portainerClient, err := common.GetClient()
|
||||
common.CheckError(err)
|
||||
|
@ -16,6 +16,11 @@ import (
|
||||
var statusCmd = &cobra.Command{
|
||||
Use: "status",
|
||||
Short: "Check Portainer status",
|
||||
Example: ` Print status in a table format:
|
||||
psu status
|
||||
|
||||
Print version of Portainer server:
|
||||
psu status --format "{{ .Version }}"`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
client, err := common.GetClient()
|
||||
common.CheckError(err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user