From 3dcd809ee8cb59f81bd709cbc6ab6cc3ed9e71d5 Mon Sep 17 00:00:00 2001 From: Chmouel Boudjnah Date: Fri, 11 Oct 2024 15:12:50 +0200 Subject: [PATCH] feat(cli): add shorthand -a for --all flags Added shorthand 'a' for the --all flag in various delete commands which has a --all to improve usability and consistency across the CLI and with kubectl. This change affects the following commands: - ClusterTriggerBinding delete - EventListener delete - Pipeline delete - PipelineRun delete - Task delete - TaskRun delete - TriggerBinding delete - TriggerTemplate delete Signed-off-by: Chmouel Boudjnah --- docs/cmd/tkn_clustertriggerbinding_delete.md | 2 +- docs/cmd/tkn_eventlistener_delete.md | 2 +- docs/cmd/tkn_pipeline_delete.md | 2 +- docs/cmd/tkn_pipelinerun_delete.md | 2 +- docs/cmd/tkn_task_delete.md | 2 +- docs/cmd/tkn_taskrun_delete.md | 2 +- docs/cmd/tkn_triggerbinding_delete.md | 2 +- docs/cmd/tkn_triggertemplate_delete.md | 2 +- docs/man/man1/tkn-clustertriggerbinding-delete.1 | 2 +- docs/man/man1/tkn-eventlistener-delete.1 | 2 +- docs/man/man1/tkn-pipeline-delete.1 | 2 +- docs/man/man1/tkn-pipelinerun-delete.1 | 2 +- docs/man/man1/tkn-task-delete.1 | 2 +- docs/man/man1/tkn-taskrun-delete.1 | 2 +- docs/man/man1/tkn-triggerbinding-delete.1 | 2 +- docs/man/man1/tkn-triggertemplate-delete.1 | 2 +- pkg/cmd/clustertriggerbinding/delete.go | 2 +- pkg/cmd/eventlistener/delete.go | 2 +- pkg/cmd/pipeline/delete.go | 2 +- pkg/cmd/pipelinerun/delete.go | 2 +- pkg/cmd/task/delete.go | 2 +- pkg/cmd/taskrun/delete.go | 2 +- pkg/cmd/triggerbinding/delete.go | 2 +- pkg/cmd/triggertemplate/delete.go | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/docs/cmd/tkn_clustertriggerbinding_delete.md b/docs/cmd/tkn_clustertriggerbinding_delete.md index 19000fa49c..630bed819c 100644 --- a/docs/cmd/tkn_clustertriggerbinding_delete.md +++ b/docs/cmd/tkn_clustertriggerbinding_delete.md @@ -28,7 +28,7 @@ or ### Options ``` - --all Delete all ClusterTriggerBindings (default: false) + -a, --all Delete all ClusterTriggerBindings (default: false) --allow-missing-template-keys If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. (default true) -f, --force Whether to force deletion (default: false) -h, --help help for delete diff --git a/docs/cmd/tkn_eventlistener_delete.md b/docs/cmd/tkn_eventlistener_delete.md index 940b8fc91e..c0c62198d1 100644 --- a/docs/cmd/tkn_eventlistener_delete.md +++ b/docs/cmd/tkn_eventlistener_delete.md @@ -28,7 +28,7 @@ or ### Options ``` - --all Delete all EventListeners in a namespace (default: false) + -a, --all Delete all EventListeners in a namespace (default: false) --allow-missing-template-keys If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. (default true) -f, --force Whether to force deletion (default: false) -h, --help help for delete diff --git a/docs/cmd/tkn_pipeline_delete.md b/docs/cmd/tkn_pipeline_delete.md index 8040196593..406c37c3a5 100644 --- a/docs/cmd/tkn_pipeline_delete.md +++ b/docs/cmd/tkn_pipeline_delete.md @@ -28,7 +28,7 @@ or ### Options ``` - --all Delete all Pipelines in a namespace (default: false) + -a, --all Delete all Pipelines in a namespace (default: false) --allow-missing-template-keys If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. (default true) -f, --force Whether to force deletion (default: false) -h, --help help for delete diff --git a/docs/cmd/tkn_pipelinerun_delete.md b/docs/cmd/tkn_pipelinerun_delete.md index 9aa83acac8..80e7f22663 100644 --- a/docs/cmd/tkn_pipelinerun_delete.md +++ b/docs/cmd/tkn_pipelinerun_delete.md @@ -28,7 +28,7 @@ or ### Options ``` - --all Delete all PipelineRuns in a namespace (default: false) + -a, --all Delete all PipelineRuns in a namespace (default: false) --allow-missing-template-keys If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. (default true) -f, --force Whether to force deletion (default: false) -h, --help help for delete diff --git a/docs/cmd/tkn_task_delete.md b/docs/cmd/tkn_task_delete.md index 917e2ec111..66b1d365c9 100644 --- a/docs/cmd/tkn_task_delete.md +++ b/docs/cmd/tkn_task_delete.md @@ -28,7 +28,7 @@ or ### Options ``` - --all Delete all Tasks in a namespace (default: false) + -a, --all Delete all Tasks in a namespace (default: false) --allow-missing-template-keys If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. (default true) -f, --force Whether to force deletion (default: false) -h, --help help for delete diff --git a/docs/cmd/tkn_taskrun_delete.md b/docs/cmd/tkn_taskrun_delete.md index 50c88ae28c..018c7bf3d5 100644 --- a/docs/cmd/tkn_taskrun_delete.md +++ b/docs/cmd/tkn_taskrun_delete.md @@ -28,7 +28,7 @@ or ### Options ``` - --all Delete all TaskRuns in a namespace (default: false) + -a, --all Delete all TaskRuns in a namespace (default: false) --allow-missing-template-keys If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. (default true) --clustertask string The name of a ClusterTask whose TaskRuns should be deleted (does not delete the ClusterTask) -f, --force Whether to force deletion (default: false) diff --git a/docs/cmd/tkn_triggerbinding_delete.md b/docs/cmd/tkn_triggerbinding_delete.md index 217360cbb6..a8700697e7 100644 --- a/docs/cmd/tkn_triggerbinding_delete.md +++ b/docs/cmd/tkn_triggerbinding_delete.md @@ -28,7 +28,7 @@ or ### Options ``` - --all Delete all TriggerBindings in a namespace (default: false) + -a, --all Delete all TriggerBindings in a namespace (default: false) --allow-missing-template-keys If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. (default true) -f, --force Whether to force deletion (default: false) -h, --help help for delete diff --git a/docs/cmd/tkn_triggertemplate_delete.md b/docs/cmd/tkn_triggertemplate_delete.md index 2b932957c2..003702d491 100644 --- a/docs/cmd/tkn_triggertemplate_delete.md +++ b/docs/cmd/tkn_triggertemplate_delete.md @@ -28,7 +28,7 @@ or ### Options ``` - --all Delete all TriggerTemplates in a namespace (default: false) + -a, --all Delete all TriggerTemplates in a namespace (default: false) --allow-missing-template-keys If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. (default true) -f, --force Whether to force deletion (default: false) -h, --help help for delete diff --git a/docs/man/man1/tkn-clustertriggerbinding-delete.1 b/docs/man/man1/tkn-clustertriggerbinding-delete.1 index 0baefb1551..7f6bdf85c0 100644 --- a/docs/man/man1/tkn-clustertriggerbinding-delete.1 +++ b/docs/man/man1/tkn-clustertriggerbinding-delete.1 @@ -20,7 +20,7 @@ Delete ClusterTriggerBindings .SH OPTIONS .PP -\fB\-\-all\fP[=false] +\fB\-a\fP, \fB\-\-all\fP[=false] Delete all ClusterTriggerBindings (default: false) .PP diff --git a/docs/man/man1/tkn-eventlistener-delete.1 b/docs/man/man1/tkn-eventlistener-delete.1 index 06439f66fb..ae92a1738b 100644 --- a/docs/man/man1/tkn-eventlistener-delete.1 +++ b/docs/man/man1/tkn-eventlistener-delete.1 @@ -20,7 +20,7 @@ Delete EventListeners in a namespace .SH OPTIONS .PP -\fB\-\-all\fP[=false] +\fB\-a\fP, \fB\-\-all\fP[=false] Delete all EventListeners in a namespace (default: false) .PP diff --git a/docs/man/man1/tkn-pipeline-delete.1 b/docs/man/man1/tkn-pipeline-delete.1 index 84bd46e945..cfb7abb921 100644 --- a/docs/man/man1/tkn-pipeline-delete.1 +++ b/docs/man/man1/tkn-pipeline-delete.1 @@ -20,7 +20,7 @@ Delete Pipelines in a namespace .SH OPTIONS .PP -\fB\-\-all\fP[=false] +\fB\-a\fP, \fB\-\-all\fP[=false] Delete all Pipelines in a namespace (default: false) .PP diff --git a/docs/man/man1/tkn-pipelinerun-delete.1 b/docs/man/man1/tkn-pipelinerun-delete.1 index b47dadae38..b2e3b419b7 100644 --- a/docs/man/man1/tkn-pipelinerun-delete.1 +++ b/docs/man/man1/tkn-pipelinerun-delete.1 @@ -20,7 +20,7 @@ Delete PipelineRuns in a namespace .SH OPTIONS .PP -\fB\-\-all\fP[=false] +\fB\-a\fP, \fB\-\-all\fP[=false] Delete all PipelineRuns in a namespace (default: false) .PP diff --git a/docs/man/man1/tkn-task-delete.1 b/docs/man/man1/tkn-task-delete.1 index 84cf5b3829..11df50fe5a 100644 --- a/docs/man/man1/tkn-task-delete.1 +++ b/docs/man/man1/tkn-task-delete.1 @@ -20,7 +20,7 @@ Delete Tasks in a namespace .SH OPTIONS .PP -\fB\-\-all\fP[=false] +\fB\-a\fP, \fB\-\-all\fP[=false] Delete all Tasks in a namespace (default: false) .PP diff --git a/docs/man/man1/tkn-taskrun-delete.1 b/docs/man/man1/tkn-taskrun-delete.1 index f320f44e2c..d11b2479b7 100644 --- a/docs/man/man1/tkn-taskrun-delete.1 +++ b/docs/man/man1/tkn-taskrun-delete.1 @@ -20,7 +20,7 @@ Delete TaskRuns in a namespace .SH OPTIONS .PP -\fB\-\-all\fP[=false] +\fB\-a\fP, \fB\-\-all\fP[=false] Delete all TaskRuns in a namespace (default: false) .PP diff --git a/docs/man/man1/tkn-triggerbinding-delete.1 b/docs/man/man1/tkn-triggerbinding-delete.1 index 58bdd96699..36553d39e7 100644 --- a/docs/man/man1/tkn-triggerbinding-delete.1 +++ b/docs/man/man1/tkn-triggerbinding-delete.1 @@ -20,7 +20,7 @@ Delete TriggerBindings in a namespace .SH OPTIONS .PP -\fB\-\-all\fP[=false] +\fB\-a\fP, \fB\-\-all\fP[=false] Delete all TriggerBindings in a namespace (default: false) .PP diff --git a/docs/man/man1/tkn-triggertemplate-delete.1 b/docs/man/man1/tkn-triggertemplate-delete.1 index 76a9698bf4..21cc3429a4 100644 --- a/docs/man/man1/tkn-triggertemplate-delete.1 +++ b/docs/man/man1/tkn-triggertemplate-delete.1 @@ -20,7 +20,7 @@ Delete TriggerTemplates in a namespace .SH OPTIONS .PP -\fB\-\-all\fP[=false] +\fB\-a\fP, \fB\-\-all\fP[=false] Delete all TriggerTemplates in a namespace (default: false) .PP diff --git a/pkg/cmd/clustertriggerbinding/delete.go b/pkg/cmd/clustertriggerbinding/delete.go index 50dac049a7..5458fa2997 100644 --- a/pkg/cmd/clustertriggerbinding/delete.go +++ b/pkg/cmd/clustertriggerbinding/delete.go @@ -96,7 +96,7 @@ or } f.AddFlags(c) c.Flags().BoolVarP(&opts.ForceDelete, "force", "f", false, "Whether to force deletion (default: false)") - c.Flags().BoolVarP(&opts.DeleteAll, "all", "", false, "Delete all ClusterTriggerBindings (default: false)") + c.Flags().BoolVarP(&opts.DeleteAll, "all", "a", false, "Delete all ClusterTriggerBindings (default: false)") return c } diff --git a/pkg/cmd/eventlistener/delete.go b/pkg/cmd/eventlistener/delete.go index 3b7dee8170..c7f76430da 100644 --- a/pkg/cmd/eventlistener/delete.go +++ b/pkg/cmd/eventlistener/delete.go @@ -97,7 +97,7 @@ or } f.AddFlags(c) c.Flags().BoolVarP(&opts.ForceDelete, "force", "f", false, "Whether to force deletion (default: false)") - c.Flags().BoolVarP(&opts.DeleteAllNs, "all", "", false, "Delete all EventListeners in a namespace (default: false)") + c.Flags().BoolVarP(&opts.DeleteAllNs, "all", "a", false, "Delete all EventListeners in a namespace (default: false)") return c } diff --git a/pkg/cmd/pipeline/delete.go b/pkg/cmd/pipeline/delete.go index 4c5a45c001..7d4759fefc 100644 --- a/pkg/cmd/pipeline/delete.go +++ b/pkg/cmd/pipeline/delete.go @@ -101,7 +101,7 @@ or f.AddFlags(c) c.Flags().BoolVarP(&opts.ForceDelete, "force", "f", false, "Whether to force deletion (default: false)") c.Flags().BoolVarP(&opts.DeleteRelated, "prs", "", false, "Whether to delete Pipeline(s) and related resources (PipelineRuns) (default: false)") - c.Flags().BoolVarP(&opts.DeleteAllNs, "all", "", false, "Delete all Pipelines in a namespace (default: false)") + c.Flags().BoolVarP(&opts.DeleteAllNs, "all", "a", false, "Delete all Pipelines in a namespace (default: false)") return c } diff --git a/pkg/cmd/pipelinerun/delete.go b/pkg/cmd/pipelinerun/delete.go index 1c231c3377..fd9f541d9a 100644 --- a/pkg/cmd/pipelinerun/delete.go +++ b/pkg/cmd/pipelinerun/delete.go @@ -128,7 +128,7 @@ or c.Flags().IntVarP(&opts.Keep, "keep", "", 0, "Keep n most recent number of PipelineRuns") c.Flags().IntVarP(&opts.KeepSince, "keep-since", "", 0, "When deleting all PipelineRuns keep the ones that has been completed since n minutes") c.Flags().BoolVarP(&opts.IgnoreRunning, "ignore-running", "i", true, "ignore running PipelineRun") - c.Flags().BoolVarP(&opts.DeleteAllNs, "all", "", false, "Delete all PipelineRuns in a namespace (default: false)") + c.Flags().BoolVarP(&opts.DeleteAllNs, "all", "a", false, "Delete all PipelineRuns in a namespace (default: false)") c.Flags().StringVarP(&opts.LabelSelector, "label", "", opts.LabelSelector, "A selector (label query) to filter on when running with --all, supports '=', '==', and '!='") return c } diff --git a/pkg/cmd/task/delete.go b/pkg/cmd/task/delete.go index 69ca6fcc64..02bb46b364 100644 --- a/pkg/cmd/task/delete.go +++ b/pkg/cmd/task/delete.go @@ -102,7 +102,7 @@ or f.AddFlags(c) c.Flags().BoolVarP(&opts.ForceDelete, "force", "f", false, "Whether to force deletion (default: false)") c.Flags().BoolVarP(&opts.DeleteRelated, "trs", "", false, "Whether to delete Task(s) and related resources (TaskRuns) (default: false)") - c.Flags().BoolVarP(&opts.DeleteAllNs, "all", "", false, "Delete all Tasks in a namespace (default: false)") + c.Flags().BoolVarP(&opts.DeleteAllNs, "all", "a", false, "Delete all Tasks in a namespace (default: false)") return c } diff --git a/pkg/cmd/taskrun/delete.go b/pkg/cmd/taskrun/delete.go index 222bb67f0d..de028fc15a 100644 --- a/pkg/cmd/taskrun/delete.go +++ b/pkg/cmd/taskrun/delete.go @@ -144,7 +144,7 @@ or c.Flags().BoolVarP(&opts.ForceDelete, "force", "f", false, "Whether to force deletion (default: false)") c.Flags().StringVarP(&deleteOpts.TaskName, "task", "t", "", "The name of a Task whose TaskRuns should be deleted (does not delete the task)") c.Flags().StringVarP(&deleteOpts.ClusterTaskName, "clustertask", "", "", "The name of a ClusterTask whose TaskRuns should be deleted (does not delete the ClusterTask)") - c.Flags().BoolVarP(&opts.DeleteAllNs, "all", "", false, "Delete all TaskRuns in a namespace (default: false)") + c.Flags().BoolVarP(&opts.DeleteAllNs, "all", "a", false, "Delete all TaskRuns in a namespace (default: false)") c.Flags().IntVarP(&opts.Keep, "keep", "", 0, "Keep n most recent number of TaskRuns") c.Flags().IntVarP(&opts.KeepSince, "keep-since", "", 0, "When deleting all TaskRuns keep the ones that has been completed since n minutes") c.Flags().BoolVarP(&opts.IgnoreRunning, "ignore-running", "i", true, "ignore running TaskRun") diff --git a/pkg/cmd/triggerbinding/delete.go b/pkg/cmd/triggerbinding/delete.go index b9383ad250..4d10a16d8f 100644 --- a/pkg/cmd/triggerbinding/delete.go +++ b/pkg/cmd/triggerbinding/delete.go @@ -97,7 +97,7 @@ or } f.AddFlags(c) c.Flags().BoolVarP(&opts.ForceDelete, "force", "f", false, "Whether to force deletion (default: false)") - c.Flags().BoolVarP(&opts.DeleteAllNs, "all", "", false, "Delete all TriggerBindings in a namespace (default: false)") + c.Flags().BoolVarP(&opts.DeleteAllNs, "all", "a", false, "Delete all TriggerBindings in a namespace (default: false)") return c } diff --git a/pkg/cmd/triggertemplate/delete.go b/pkg/cmd/triggertemplate/delete.go index a2b1dd2ef2..d85473f4b3 100644 --- a/pkg/cmd/triggertemplate/delete.go +++ b/pkg/cmd/triggertemplate/delete.go @@ -100,7 +100,7 @@ or } f.AddFlags(c) c.Flags().BoolVarP(&opts.ForceDelete, "force", "f", false, "Whether to force deletion (default: false)") - c.Flags().BoolVarP(&opts.DeleteAllNs, "all", "", false, "Delete all TriggerTemplates in a namespace (default: false)") + c.Flags().BoolVarP(&opts.DeleteAllNs, "all", "a", false, "Delete all TriggerTemplates in a namespace (default: false)") return c }