MCPcopy
hub / github.com/AstrBotDevs/AstrBot / _apply_startup_env_flags

Function _apply_startup_env_flags

main.py:16–30  ·  view source on GitHub ↗

Apply startup flags that must take effect before core imports. Args: argv: Command-line arguments excluding the executable name.

(argv: list[str])

Source from the content-addressed store, hash-verified

14
15
16def _apply_startup_env_flags(argv: list[str]) -> None:
17 """Apply startup flags that must take effect before core imports.
18
19 Args:
20 argv: Command-line arguments excluding the executable name.
21 """
22
23 if "-h" in argv or "--help" in argv:
24 return
25
26 startup_parser = argparse.ArgumentParser(add_help=False)
27 startup_parser.add_argument("--reset-password", action="store_true")
28 startup_args, _ = startup_parser.parse_known_args(argv)
29 if startup_args.reset_password:
30 os.environ[DASHBOARD_RESET_PASSWORD_ENV] = "1"
31
32
33_apply_startup_env_flags(sys.argv[1:])

Calls

no outgoing calls