diff --git a/cmd/endpointGroupList.go b/cmd/endpointGroupList.go index f33323e..d64d378 100644 --- a/cmd/endpointGroupList.go +++ b/cmd/endpointGroupList.go @@ -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) diff --git a/cmd/endpointList.go b/cmd/endpointList.go index 5edfc29..db5e150 100644 --- a/cmd/endpointList.go +++ b/cmd/endpointList.go @@ -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) diff --git a/cmd/stackList.go b/cmd/stackList.go index 7fb726b..21cea96 100644 --- a/cmd/stackList.go +++ b/cmd/stackList.go @@ -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) diff --git a/cmd/status.go b/cmd/status.go index df59a0d..34c6c5e 100644 --- a/cmd/status.go +++ b/cmd/status.go @@ -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)