File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import (
1313)
1414
1515var rmCmd = & cobra.Command {
16- Use : "rm <path>" ,
16+ Use : "rm <path(s) >" ,
1717 Short : "Remove parameter(s) by path" ,
1818 Args : func (cmd * cobra.Command , args []string ) error {
1919 if len (args ) == 0 {
@@ -68,22 +68,30 @@ func runRmCmd(cmd *cobra.Command, args []string) {
6868 os .Exit (0 )
6969 }
7070 } else {
71- names = append (names , & path )
71+ for _ , arg := range args {
72+ // declare in loop for pointer to not be repeated
73+ str := arg
74+ names = append (names , & str )
75+ }
7276 }
7377
7478 chunks := getStringChunks (names , 10 )
7579
80+ num := 0
81+
7682 for _ , chunk := range chunks {
77- _ , err := client .DeleteParameters (& ssm.DeleteParametersInput {
83+ res , err := client .DeleteParameters (& ssm.DeleteParametersInput {
7884 Names : chunk ,
7985 })
8086
8187 if err != nil {
8288 panic (err )
8389 }
90+
91+ num += len (res .DeletedParameters )
8492 }
8593
86- fmt .Println (text .FgGreen .Sprintf ("Deleted %d parameters successfully" , len ( names ) ))
94+ fmt .Println (text .FgGreen .Sprintf ("Deleted %d parameters successfully" , num ))
8795}
8896
8997func init () {
You can’t perform that action at this time.
0 commit comments