39
39
chain = True , # allow using multiple commands in a single run
40
40
no_args_is_help = True ,
41
41
context_settings = dict (help_option_names = ["-h" , "--help" ], max_content_width = 120 ),
42
- help = f"espefuse v{ esptool .__version__ } - ESP32xx eFuse get/set tool" ,
42
+ help = f"espefuse v{ esptool .__version__ } - "
43
+ "Utility for eFuse configuration in Espressif SoCs." ,
43
44
)
44
45
@click .option (
45
46
"--chip" ,
46
47
"-c" ,
47
48
type = ChipType (choices = ["auto" ] + list (SUPPORTED_CHIPS .keys ())),
48
49
default = "auto" ,
49
50
envvar = "ESPTOOL_CHIP" ,
50
- help = "Target chip type" ,
51
+ help = "Target chip type. " ,
51
52
)
52
53
@click .option (
53
54
"--baud" ,
54
55
"-b" ,
55
56
type = int ,
56
57
default = esptool .ESPLoader .ESP_ROM_BAUD ,
57
58
envvar = "ESPTOOL_BAUD" ,
58
- help = "Serial port baud rate used when flashing/reading" ,
59
+ help = "Serial port baud rate used when flashing/reading. " ,
59
60
)
60
61
@click .option (
61
62
"--port" ,
62
63
"-p" ,
63
64
envvar = "ESPTOOL_PORT" ,
64
- help = "Serial port device" ,
65
+ help = "Serial port device. " ,
65
66
)
66
67
@click .option (
67
68
"--before" ,
68
69
type = ResetModeType (
69
70
choices = ["default-reset" , "usb-reset" , "no-reset" , "no-reset-no-sync" ]
70
71
),
71
72
default = "default-reset" ,
72
- help = "What to do before connecting to the chip" ,
73
+ help = "Which reset to perform before connecting to the chip. " ,
73
74
)
74
75
@click .option (
75
- "--debug" , "-d" , is_flag = True , help = "Show debugging information (loglevel=DEBUG)"
76
+ "--debug" , "-d" , is_flag = True , help = "Show debugging information (loglevel=DEBUG). "
76
77
)
77
78
@click .option (
78
79
"--virt" ,
79
80
is_flag = True ,
80
- help = "For host tests, work in virtual mode (no chip connection)" ,
81
+ help = "For host tests, work in virtual mode (no chip connection). " ,
81
82
)
82
83
@click .option (
83
84
"--path-efuse-file" ,
84
85
type = click .Path (),
85
- help = "For host tests, saves efuse memory to file" ,
86
+ help = "For host tests, save eFuse memory to file. " ,
86
87
)
87
88
@click .option (
88
89
"--do-not-confirm" ,
89
90
is_flag = True ,
90
- help = "Do not pause for confirmation before permanently writing efuses . "
91
- "Use with caution. " ,
91
+ help = "Do not pause for confirmation before permanently writing eFuses . "
92
+ "Use with caution! " ,
92
93
)
93
94
@click .option (
94
95
"--postpone" ,
95
96
is_flag = True ,
96
- help = "Postpone burning some efuses from BLOCK0 at the end" ,
97
+ help = "Postpone burning some eFuses from BLOCK0 at the end. " ,
97
98
)
98
99
@click .option (
99
100
"--extend-efuse-table" ,
100
101
type = click .File ("r" ),
101
- help = "CSV file from ESP-IDF (esp_efuse_custom_table.csv)" ,
102
+ help = "CSV file from ESP-IDF (esp_efuse_custom_table.csv). " ,
102
103
)
103
104
@click .pass_context
104
105
def cli (
@@ -114,7 +115,7 @@ def cli(
114
115
postpone ,
115
116
extend_efuse_table ,
116
117
):
117
- print (f"espefuse v{ esptool .__version__ } " )
118
+ log . print (f"espefuse v{ esptool .__version__ } " )
118
119
119
120
ctx .ensure_object (dict )
120
121
esp = ctx .obj .get ("esp" , None )
@@ -127,7 +128,7 @@ def cli(
127
128
128
129
if not port and not external_esp and not is_help and not virt :
129
130
raise click .BadOptionUsage (
130
- "--port" , "Missing required argument. Please specify the --port option"
131
+ "--port" , "Missing required argument. Please specify the --port option. "
131
132
)
132
133
133
134
if not esp :
@@ -137,7 +138,7 @@ def cli(
137
138
)
138
139
except esptool .FatalError as e :
139
140
raise esptool .FatalError (
140
- f"{ e } \n Please make sure you specified the right port with --port"
141
+ f"{ e } \n Please make sure you specified the right port with --port. "
141
142
)
142
143
143
144
def close_port ():
@@ -181,8 +182,8 @@ def close_port():
181
182
def process_result (result , * args , ** kwargs ):
182
183
if multiple_burn_commands :
183
184
if not commands .burn_all (check_batch_mode = True ):
184
- raise esptool .FatalError ("BURN was not done" )
185
- print ("Successful" )
185
+ raise esptool .FatalError ("BURN was not done. " )
186
+ log . print ("Successful. " )
186
187
187
188
188
189
@cli .command ("execute-scripts" , hidden = True )
0 commit comments