File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 15
15
default = False ,
16
16
is_flag = True ,
17
17
)
18
- def delete_model (multi : bool ):
18
+ @click .option (
19
+ "--yes" ,
20
+ "-y" ,
21
+ help = "Skip confirmation prompt for deletion" ,
22
+ type = bool ,
23
+ default = False ,
24
+ is_flag = True ,
25
+ )
26
+ def delete_model (multi : bool , yes : bool ):
19
27
"""
20
28
Deletes the selected model/s
21
29
"""
@@ -31,5 +39,16 @@ def delete_model(multi: bool):
31
39
if selections :
32
40
for selection in selections :
33
41
normalized_selection = selection .split ()[0 ]
34
- ollama .delete (normalized_selection )
42
+ if not yes :
43
+ confirm = input (
44
+ f"Are you sure you want to delete '\033 [91m{ normalized_selection } \033 [0m'? \n [y(yes) | n(no)] "
45
+ )
46
+
47
+ if confirm .strip () in ("yes" , "y" ):
48
+ ollama .delete (normalized_selection )
49
+ else :
50
+ print ("❌ Exited delete mode." )
51
+ sys .exit (0 )
52
+ else :
53
+ ollama .delete (normalized_selection )
35
54
print (f"🗑️ Deleted model: { normalized_selection } " )
You can’t perform that action at this time.
0 commit comments