@@ -13,14 +13,26 @@ def _format_action_invocation(self, action):
1313 return '/' .join (action .option_strings ) + ' ' + args_string
1414
1515
16+ description = 'Utility for saving VKontakte conversations'
17+ epilog = '''examples:
18+ %(prog)s -vv -i c45,558891166 dump --export-json
19+ %(prog)s -e 100,-22822305 parse -f html
20+ %(prog)s atch --ts photos,audios
21+ '''
22+
23+
1624def parse_args ():
1725 """
1826 Создает объект парсера и парсит аргументы
1927
2028 Returns:
2129 argparse.Namespace: Набор аргументов парсера
2230 """
23- parser = ArgumentParser (formatter_class = CustomHelpFormatter )
31+ parser = ArgumentParser (
32+ formatter_class = CustomHelpFormatter ,
33+ description = description ,
34+ epilog = epilog
35+ )
2436
2537 parser .add_argument (
2638 '-o' ,
@@ -66,7 +78,9 @@ def parse_args():
6678 'dump' ,
6779 help = 'Save only the necessary information (VK API method outputs) '
6880 'in a machine-friendly format (SQLite + JSON) for further processing' ,
69- formatter_class = CustomHelpFormatter
81+ formatter_class = CustomHelpFormatter ,
82+ description = description ,
83+ epilog = epilog
7084 )
7185
7286 parser_dump .add_argument (
@@ -105,7 +119,9 @@ def parse_args():
105119 parser_parse = subparsers .add_parser (
106120 'parse' ,
107121 help = 'Convert machine-friendly JSON format to human-readable' ,
108- formatter_class = CustomHelpFormatter
122+ formatter_class = CustomHelpFormatter ,
123+ description = description ,
124+ epilog = epilog
109125 )
110126
111127 parser_parse .add_argument (
@@ -121,7 +137,9 @@ def parse_args():
121137 parser_atch = subparsers .add_parser (
122138 'atch' ,
123139 help = 'Download messages attachments (photos, audio, etc.)' ,
124- formatter_class = CustomHelpFormatter
140+ formatter_class = CustomHelpFormatter ,
141+ description = description ,
142+ epilog = epilog
125143 )
126144
127145 parser_atch .add_argument (
0 commit comments