99
1010import json
1111import locale
12- from argparse import ArgumentParser , ArgumentTypeError , BooleanOptionalAction , HelpFormatter , Namespace
12+ from argparse import ArgumentParser , ArgumentTypeError , BooleanOptionalAction , Namespace , RawDescriptionHelpFormatter
1313from operator import attrgetter
1414from pathlib import Path
1515from typing import TYPE_CHECKING , cast
@@ -62,8 +62,8 @@ def _dataclass_arguments(value: str) -> DataclassArguments:
6262 return cast ("DataclassArguments" , result )
6363
6464
65- class SortingHelpFormatter (HelpFormatter ):
66- """Help formatter that sorts arguments and adds color to section headers."""
65+ class SortingHelpFormatter (RawDescriptionHelpFormatter ):
66+ """Help formatter that sorts arguments, adds color to section headers, and preserves epilog formatting ."""
6767
6868 def _bold_cyan (self , text : str ) -> str : # noqa: PLR6301
6969 """Wrap text in ANSI bold cyan escape codes."""
@@ -81,7 +81,10 @@ def start_section(self, heading: str | None) -> None:
8181
8282arg_parser = ArgumentParser (
8383 usage = "\n datamodel-codegen [options]" ,
84- description = "Generate Python data models from schema definitions or structured data" ,
84+ description = "Generate Python data models from schema definitions or structured data\n \n "
85+ "For detailed usage, see: https://koxudaxi.github.io/datamodel-code-generator" ,
86+ epilog = "Documentation: https://koxudaxi.github.io/datamodel-code-generator\n "
87+ "GitHub: https://github.com/koxudaxi/datamodel-code-generator" ,
8588 formatter_class = SortingHelpFormatter ,
8689 add_help = False ,
8790)
0 commit comments