Skip to content

Commit 883b380

Browse files
committed
Reorder args in help
1 parent a46865d commit 883b380

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

json_to_models/cli.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -214,27 +214,28 @@ def _create_argparser(cls) -> argparse.ArgumentParser:
214214
"I.e. for file that contains dict {\"a\": {\"b\": [model_data, ...]}} you should\n"
215215
"pass 'a.b' as <JSON key>.\n\n"
216216
)
217+
parser.add_argument(
218+
"-f", "--framework",
219+
default="base",
220+
choices=list(cls.MODEL_GENERATOR_MAPPING.keys()) + ["custom"],
221+
help="Model framework for which python code is generated.\n"
222+
"'base' (default) mean no framework so code will be generated without any decorators\n"
223+
"and additional meta-data.\n"
224+
"If you pass 'custom' you should specify --code-generator argument\n\n"
225+
)
226+
parser.add_argument(
227+
"-s", "--structure",
228+
default="nested",
229+
choices=list(cls.STRUCTURE_FN_MAPPING.keys()),
230+
help="Models composition style. By default nested models become nested Python classes.\n\n"
231+
)
217232
parser.add_argument(
218233
"--datetime",
219234
action="store_true",
220235
help="Enable datetime/date/time strings parsing.\n"
221236
"Warn.: This can lead to 6-7 times slowdown on large datasets.\n"
222237
" Be sure that you really need this option.\n\n"
223238
)
224-
parser.add_argument(
225-
"--dict-keys-regex", "--dkr",
226-
nargs="+", metavar="RegEx",
227-
help="List of regular expressions (Python syntax).\n"
228-
"If all keys of some dict are match one of them\n"
229-
"then this dict will be marked as dict field but not nested model.\n"
230-
"Note: ^ and $ tokens will be added automatically but you have to\n"
231-
"escape other special characters manually.\n"
232-
)
233-
parser.add_argument(
234-
"--dict-keys-fields", "--dkf",
235-
nargs="+", metavar="FIELD NAME",
236-
help="List of model fields names that will be marked as dict fields\n\n"
237-
)
238239

239240
default_percent = f"{ModelFieldsPercentMatch.DEFAULT * 100:.0f}"
240241
default_number = f"{ModelFieldsNumberMatch.DEFAULT:.0f}"
@@ -253,19 +254,18 @@ def _create_argparser(cls) -> argparse.ArgumentParser:
253254
"'exact' - two models should have exact same field names to merge.\n\n"
254255
)
255256
parser.add_argument(
256-
"-s", "--structure",
257-
default="nested",
258-
choices=list(cls.STRUCTURE_FN_MAPPING.keys()),
259-
help="Models composition style. By default nested models become nested Python classes.\n\n"
257+
"--dict-keys-regex", "--dkr",
258+
nargs="+", metavar="RegEx",
259+
help="List of regular expressions (Python syntax).\n"
260+
"If all keys of some dict are match one of them\n"
261+
"then this dict will be marked as dict field but not nested model.\n"
262+
"Note: ^ and $ tokens will be added automatically but you have to\n"
263+
"escape other special characters manually.\n"
260264
)
261265
parser.add_argument(
262-
"-f", "--framework",
263-
default="base",
264-
choices=list(cls.MODEL_GENERATOR_MAPPING.keys()) + ["custom"],
265-
help="Model framework for which python code is generated.\n"
266-
"'base' (default) mean no framework so code will be generated without any decorators\n"
267-
"and additional meta-data.\n"
268-
"If you pass 'custom' you should specify --code-generator argument\n\n"
266+
"--dict-keys-fields", "--dkf",
267+
nargs="+", metavar="FIELD NAME",
268+
help="List of model fields names that will be marked as dict fields\n\n"
269269
)
270270
parser.add_argument(
271271
"--code-generator",

0 commit comments

Comments
 (0)