From 883b380b64513580b7ad7f63c79453af13fa43e1 Mon Sep 17 00:00:00 2001 From: bogdandm Date: Wed, 24 Apr 2019 16:35:53 +0300 Subject: [PATCH] Reorder args in help --- json_to_models/cli.py | 50 +++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/json_to_models/cli.py b/json_to_models/cli.py index aaf8e19..25f6230 100644 --- a/json_to_models/cli.py +++ b/json_to_models/cli.py @@ -214,6 +214,21 @@ def _create_argparser(cls) -> argparse.ArgumentParser: "I.e. for file that contains dict {\"a\": {\"b\": [model_data, ...]}} you should\n" "pass 'a.b' as .\n\n" ) + parser.add_argument( + "-f", "--framework", + default="base", + choices=list(cls.MODEL_GENERATOR_MAPPING.keys()) + ["custom"], + help="Model framework for which python code is generated.\n" + "'base' (default) mean no framework so code will be generated without any decorators\n" + "and additional meta-data.\n" + "If you pass 'custom' you should specify --code-generator argument\n\n" + ) + parser.add_argument( + "-s", "--structure", + default="nested", + choices=list(cls.STRUCTURE_FN_MAPPING.keys()), + help="Models composition style. By default nested models become nested Python classes.\n\n" + ) parser.add_argument( "--datetime", action="store_true", @@ -221,20 +236,6 @@ def _create_argparser(cls) -> argparse.ArgumentParser: "Warn.: This can lead to 6-7 times slowdown on large datasets.\n" " Be sure that you really need this option.\n\n" ) - parser.add_argument( - "--dict-keys-regex", "--dkr", - nargs="+", metavar="RegEx", - help="List of regular expressions (Python syntax).\n" - "If all keys of some dict are match one of them\n" - "then this dict will be marked as dict field but not nested model.\n" - "Note: ^ and $ tokens will be added automatically but you have to\n" - "escape other special characters manually.\n" - ) - parser.add_argument( - "--dict-keys-fields", "--dkf", - nargs="+", metavar="FIELD NAME", - help="List of model fields names that will be marked as dict fields\n\n" - ) default_percent = f"{ModelFieldsPercentMatch.DEFAULT * 100:.0f}" default_number = f"{ModelFieldsNumberMatch.DEFAULT:.0f}" @@ -253,19 +254,18 @@ def _create_argparser(cls) -> argparse.ArgumentParser: "'exact' - two models should have exact same field names to merge.\n\n" ) parser.add_argument( - "-s", "--structure", - default="nested", - choices=list(cls.STRUCTURE_FN_MAPPING.keys()), - help="Models composition style. By default nested models become nested Python classes.\n\n" + "--dict-keys-regex", "--dkr", + nargs="+", metavar="RegEx", + help="List of regular expressions (Python syntax).\n" + "If all keys of some dict are match one of them\n" + "then this dict will be marked as dict field but not nested model.\n" + "Note: ^ and $ tokens will be added automatically but you have to\n" + "escape other special characters manually.\n" ) parser.add_argument( - "-f", "--framework", - default="base", - choices=list(cls.MODEL_GENERATOR_MAPPING.keys()) + ["custom"], - help="Model framework for which python code is generated.\n" - "'base' (default) mean no framework so code will be generated without any decorators\n" - "and additional meta-data.\n" - "If you pass 'custom' you should specify --code-generator argument\n\n" + "--dict-keys-fields", "--dkf", + nargs="+", metavar="FIELD NAME", + help="List of model fields names that will be marked as dict fields\n\n" ) parser.add_argument( "--code-generator",