Skip to content

Commit a2f0c79

Browse files
committed
Support shortcut (del) of the delete action
1 parent 1f97b5c commit a2f0c79

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func args2cmd(args []string) (string, []string) {
6969
}
7070

7171
for _, arg := range args {
72-
if arg == "delete" {
72+
if arg == "delete" || arg == "del" {
7373
if os.Getenv("DELETE") == "true" {
7474
break
7575
}

tests.sh

+15
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,17 @@ _fail_to_delete() {
106106
)
107107
}
108108

109+
_fail_to_del() {
110+
(
111+
touch ~/.config/gk8s/foobar
112+
# shellcheck disable=SC2030
113+
# shellcheck disable=SC2031
114+
PATH="$(pwd -P)":$PATH
115+
export PATH
116+
_gk8s :foobar del pods
117+
)
118+
}
119+
109120
_ok_to_delete() {
110121
(
111122
touch ~/.config/gk8s/foobar
@@ -214,6 +225,10 @@ default() {
214225
"File .delete does.* exist" \
215226
"Fail to delete because .delete file not found."
216227

228+
_test _fail_to_del \
229+
"File .delete does.* exist" \
230+
"Fail to del(ete) because .delete file not found."
231+
217232
_test _ok_to_delete \
218233
"File .delete was removed." \
219234
"Flag file will be removed first."

0 commit comments

Comments
 (0)