File tree 1 file changed +13
-0
lines changed
src/cli/eest/make/commands
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 7
7
"""
8
8
9
9
import os
10
+ import signal
10
11
import sys
11
12
from pathlib import Path
12
13
23
24
)
24
25
25
26
27
+ def exit_now ():
28
+ """Helper function to allow user to interrupt execution instantly via ctrl+C."""
29
+ print ("Ctrl+C detected, exiting.." )
30
+ exit (0 )
31
+
32
+
26
33
@click .command (
27
34
short_help = "Generate a new test file for an EIP." ,
28
35
epilog = f"Further help: { DocsConfig ().DOCS_URL__WRITING_TESTS } " ,
@@ -53,9 +60,13 @@ def test():
53
60
test_type = input_select (
54
61
"Choose the type of test to generate" , choices = ["State" , "Blockchain" ]
55
62
)
63
+ if test_type is None :
64
+ exit_now ()
56
65
57
66
fork_choices = [str (fork ) for fork in get_forks ()]
58
67
fork = input_select ("Select the fork" , choices = fork_choices )
68
+ if fork is None :
69
+ exit_now ()
59
70
60
71
base_path = Path ("tests" ) / fork .lower ()
61
72
base_path .mkdir (parents = True , exist_ok = True )
@@ -70,6 +81,8 @@ def test():
70
81
{"name" : "** Create new sub-directory **" , "value" : "new" },
71
82
],
72
83
)
84
+ if location_choice is None :
85
+ exit_now ()
73
86
74
87
if location_choice == "new" :
75
88
eip_number = input_text ("Enter the EIP number (int)" ).strip ()
You can’t perform that action at this time.
0 commit comments