From bcddcc08710f7e206764d10da45873f4c56cc7e8 Mon Sep 17 00:00:00 2001 From: Ratan Gulati Date: Mon, 16 Oct 2023 21:05:57 +0530 Subject: [PATCH 1/2] feat: Add examples to --help output for remaining create PROJECT ROLE-NAME Signed-off-by: Ratan Gulati --- cmd/argocd/commands/project_role.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/argocd/commands/project_role.go b/cmd/argocd/commands/project_role.go index 987e61914d858..7b760bde70a51 100644 --- a/cmd/argocd/commands/project_role.go +++ b/cmd/argocd/commands/project_role.go @@ -18,6 +18,7 @@ import ( "github.com/argoproj/argo-cd/v2/util/errors" "github.com/argoproj/argo-cd/v2/util/io" "github.com/argoproj/argo-cd/v2/util/jwt" + "github.com/argoproj/argo-cd/v2/util/templates" ) const ( @@ -140,6 +141,11 @@ func NewProjectRoleCreateCommand(clientOpts *argocdclient.ClientOptions) *cobra. var command = &cobra.Command{ Use: "create PROJECT ROLE-NAME", Short: "Create a project role", + Example: templates.Examples(` + # Create a project role in the "my-project" project with the name "my-role". + argocd proj role create my-project my-role --description "My project role description" + `), + Run: func(c *cobra.Command, args []string) { ctx := c.Context() From bf71aa2427bd561beb65c6f5746c08b36c53023d Mon Sep 17 00:00:00 2001 From: Ratan Gulati Date: Mon, 16 Oct 2023 21:06:24 +0530 Subject: [PATCH 2/2] feat: Add examples to --help output for remaining create PROJECT ROLE-NAME Signed-off-by: Ratan Gulati --- docs/user-guide/commands/argocd_proj_role_create.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/user-guide/commands/argocd_proj_role_create.md b/docs/user-guide/commands/argocd_proj_role_create.md index 6bfbd0c077232..60974c9e1b4e6 100644 --- a/docs/user-guide/commands/argocd_proj_role_create.md +++ b/docs/user-guide/commands/argocd_proj_role_create.md @@ -8,6 +8,13 @@ Create a project role argocd proj role create PROJECT ROLE-NAME [flags] ``` +### Examples + +``` + # Create a project role in the "my-project" project with the name "my-role". + argocd proj role create my-project my-role --description "My project role description" +``` + ### Options ```