Python Version
3.14-3.15
Docs Page
https://docs.python.org/zh-cn/3/library/argparse.html#usage
Original Translation
当为主解析器指定了自定义用法消息时,你可能还需要考虑将 prog 参数传递给 add_subparsers(),或 prog 和 usage 参数设置为 add_parser(),以确保跨子解析器的命令前缀和用法信息一致。
Original Docs Paragraph
When a custom usage message is specified for the main parser, you may also want to consider passing the prog argument to add_subparsers() or the prog and the usage arguments to add_parser(), to ensure consistent command prefixes and usage information across subparsers.
Suggested Fix
当为主解析器指定了自定义用法消息时,你可能还需要考虑将 prog 参数传递给 add_subparsers(),或将 prog 和 usage 参数传递给 add_parser(),以确保跨子解析器的命令前缀和用法信息一致。
Python Version
3.14-3.15
Docs Page
https://docs.python.org/zh-cn/3/library/argparse.html#usage
Original Translation
当为主解析器指定了自定义用法消息时,你可能还需要考虑将 prog 参数传递给 add_subparsers(),或 prog 和 usage 参数设置为 add_parser(),以确保跨子解析器的命令前缀和用法信息一致。
Original Docs Paragraph
When a custom usage message is specified for the main parser, you may also want to consider passing the prog argument to add_subparsers() or the prog and the usage arguments to add_parser(), to ensure consistent command prefixes and usage information across subparsers.
Suggested Fix
当为主解析器指定了自定义用法消息时,你可能还需要考虑将 prog 参数传递给 add_subparsers(),或将 prog 和 usage 参数传递给 add_parser(),以确保跨子解析器的命令前缀和用法信息一致。