@@ -87,7 +87,7 @@ def call_endpoint(args):
8787 if args .product_name == "custom" :
8888 parsed_data = doc_to_parse .parse (doc_type , username = args .username )
8989 else :
90- parsed_data = doc_to_parse .parse (doc_type )
90+ parsed_data = doc_to_parse .parse (doc_type , include_words = args . include_words )
9191
9292 if args .output_type == "raw" :
9393 print (json .dumps (parsed_data .http_response , indent = 2 ))
@@ -134,28 +134,35 @@ def parse_args():
134134 dest = "%s_api_key" % key_name ,
135135 help = "API key for %s document endpoint" % key_name ,
136136 )
137+ subp .add_argument (
138+ "-w" ,
139+ "--with-words" ,
140+ dest = "include_words" ,
141+ action = "store_true" ,
142+ help = "Include words in response" ,
143+ )
137144 subp .add_argument (
138145 "-i" ,
139146 "--input-type" ,
140147 dest = "input_type" ,
141148 choices = ["path" , "file" , "base64" , "bytes" ],
142149 default = "path" ,
143- help = "Specify how to handle the input, \n "
144- "path: open a path (default).\n "
145- "file: open as a file handle.\n "
146- "base64: load the from a base64 encoded text file.\n "
147- "bytes: load the contents as raw bytes." ,
150+ help = "Specify how to handle the input. \n "
151+ "- path: open a path (default).\n "
152+ "- file: open as a file handle.\n "
153+ "- base64: load the from a base64 encoded text file.\n "
154+ "- bytes: load the contents as raw bytes." ,
148155 )
149156 subp .add_argument (
150157 "-o" ,
151158 "--output-type" ,
152159 dest = "output_type" ,
153160 choices = ["summary" , "raw" , "parsed" ],
154161 default = "summary" ,
155- help = "Specify how to output the data, \n "
156- "summary: a basic summary (default)\n "
157- "raw: the raw HTTP response\n "
158- "parsed: the validated and parsed data fields\n " ,
162+ help = "Specify how to output the data. \n "
163+ "- summary: a basic summary (default)\n "
164+ "- raw: the raw HTTP response\n "
165+ "- parsed: the validated and parsed data fields\n " ,
159166 )
160167 subp .add_argument (
161168 "-C" ,
@@ -175,9 +182,6 @@ def parse_args():
175182 subp .add_argument (dest = "path" , help = "Full path to the file" )
176183
177184 parsed_args = parser .parse_args ()
178- if not parsed_args .product_name :
179- parser .print_help ()
180- sys .exit (1 )
181185 return parsed_args
182186
183187
0 commit comments