Skip to content

Commit 5f40583

Browse files
committed
fix: correct indentation for debug and verbose flags
- Fix NameError: name 'debug' is not defined - Move debug/verbose flag handling inside main_callback function - Ensure proper function scope for all variables
1 parent b477d7f commit 5f40583

1 file changed

Lines changed: 24 additions & 23 deletions

File tree

src/main.py

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -222,29 +222,30 @@ def main_callback(
222222
ctx.obj["debug"] = debug
223223
ctx.obj["verbose"] = verbose or debug
224224

225-
# Enable debug manager
226-
if debug:
227-
debug_manager.enable_debug()
228-
if verbose:
229-
debug_manager.enable_verbose()
230-
231-
if lang:
232-
save_default_lang(lang)
233-
debug_manager.verbose(f"Default language set to: {lang}")
234-
235-
config_lang = load_default_lang()
236-
selected_lang = lang or config_lang or i18n.INITIAL_LANG
237-
ctx.obj["lang"] = selected_lang
238-
239-
# Print configuration information
240-
config_info = {
241-
"Debug Mode": debug,
242-
"Verbose Mode": verbose or debug,
243-
"Selected Language": selected_lang,
244-
"Config Path": config.CONFIG_FILE_PATH, # Use the correct config path from src.config
245-
"Config File Exists": os.path.exists(config.CONFIG_FILE_PATH),
246-
"Config Content": config_lang if config_lang else "None",
247-
}
225+
# Enable debug manager
226+
if debug:
227+
debug_manager.enable_debug()
228+
if verbose:
229+
debug_manager.enable_verbose()
230+
231+
if lang:
232+
save_default_lang(lang)
233+
debug_manager.verbose(f"Default language set to: {lang}")
234+
235+
config_lang = load_default_lang()
236+
selected_lang = lang or config_lang or i18n.INITIAL_LANG
237+
ctx.obj["lang"] = selected_lang
238+
239+
# Print configuration information
240+
config_info = {
241+
"Debug Mode": debug,
242+
"Verbose Mode": verbose or debug,
243+
"Selected Language": selected_lang,
244+
"Config Path": config.CONFIG_FILE_PATH, # Use the correct config path from src.config
245+
"Config File Exists": os.path.exists(config.CONFIG_FILE_PATH),
246+
"Config Content": config_lang if config_lang else "None",
247+
}
248+
248249
debug_manager.print_config_info(config_info)
249250
debug_manager.print_environment_info()
250251
debug_manager.print_system_info()

0 commit comments

Comments
 (0)