1
- package del
1
+ package remove
2
2
3
3
import (
4
4
"fmt"
@@ -15,13 +15,13 @@ import (
15
15
)
16
16
17
17
var (
18
- shortMessage = "Delete branches"
18
+ shortMessage = "Remove branches"
19
19
20
20
longMessage = templates .LongDesc (`
21
- Delete a branch ` )
21
+ Removes branches ` )
22
22
23
23
example = templates .Examples (`
24
- cprl codecommit branch delete
24
+ cprl codecommit branch remove
25
25
` )
26
26
)
27
27
@@ -35,8 +35,8 @@ func setPersistentFlags(flags *pflag.FlagSet) {
35
35
36
36
func NewCmd () * cobra.Command {
37
37
cmd := & cobra.Command {
38
- Use : "delete " ,
39
- Aliases : []string {"d " , "del " },
38
+ Use : "remove " ,
39
+ Aliases : []string {"r " , "rem " },
40
40
Short : shortMessage ,
41
41
Long : longMessage ,
42
42
Example : example ,
@@ -73,28 +73,28 @@ func runCmd(cmd *cobra.Command, args []string) {
73
73
})
74
74
util .ExitOnErr (err )
75
75
76
- // Prompt for branches to delete
76
+ // Prompt for branches to remove
77
77
branchSelections , err := pterm .DefaultInteractiveMultiselect .
78
- WithOptions (branches ).Show ("Select branches to delete " )
78
+ WithOptions (branches ).Show ("Select branches to remove " )
79
79
util .ExitOnErr (err )
80
80
81
- // Delete branches
81
+ // Remove branches
82
82
var results []util.Result [string ]
83
- util .Spinner ("Deleting ..." , func () {
83
+ util .Spinner ("Removing ..." , func () {
84
84
results = util .DeleteBranches (ccClient , repo , branchSelections )
85
85
})
86
86
87
87
failCount := 0
88
88
for _ , r := range results {
89
89
if r .Err != nil {
90
- pterm .Error .Printf ("Failed to delete branch [%s]\n " , r .Result )
90
+ pterm .Error .Printf ("Failed to remove branch [%s]\n " , r .Result )
91
91
failCount ++
92
92
continue
93
93
}
94
- pterm .Success .Printf ("Successfully deleted branch [%s]\n " , r .Result )
94
+ pterm .Success .Printf ("Successfully removed branch [%s]\n " , r .Result )
95
95
}
96
96
97
97
if failCount > 0 {
98
- util .ExitOnErr (fmt .Errorf ("Failed to delete %d branches\n " , failCount ))
98
+ util .ExitOnErr (fmt .Errorf ("Failed to remove %d branches\n " , failCount ))
99
99
}
100
100
}
0 commit comments