Rename the json printer to jsonschema

As per dimak's request on https://review.openstack.org/#/c/523848/ the
json printer was renamed to jsonschema.
Also, for ease of use added short-name arguments as well.

Change-Id: I056bd459f22c2d1500f4d2539139f2f25a1e433e
Partial-Bug: #1734146
This commit is contained in:
Shachar Snapiri 2017-12-06 08:51:50 +02:00
parent a77ba0de6a
commit 9adaca00fc
2 changed files with 16 additions and 10 deletions

View File

@ -79,13 +79,17 @@ supported sub-commands.
This utility will allow to print a representation of the DragonFlow model in
different formats. Currently supported formats are: text, PlantUML, rst and
JsonSchema (OpenApiSchema 3.0). The output may be sent to the stdout or to a
file.
* PlantUML output can be visualized using the PlantUML Server [#]_
* rst output can be visualized using Online reStructuredText editor [#]_
different formats. Currently supported formats are: plaintext, PlantUML, rst
and JsonSchema (OpenApiSchema 3.0). The output may be sent to the stdout or
to a file.
Use the *df-model --help* command to get a detailed usage instructions.
| Use the *df-model --help* command to get a detailed usage instructions.
* PlantUML output may be visualized using the PlantUML Server [#]_
* rst output may be visualized using Online reStructuredText editor [#]_
|
.. [#] https://gist.github.com/omeranson/5c731955edcf0517bfb0ce0ce511cc9b
.. [#] http://www.plantuml.com/plantuml/uml/

View File

@ -615,14 +615,16 @@ def smart_open(filename=None):
def main():
parser = argparse.ArgumentParser(description='Print Dragonflow schema')
group = parser.add_mutually_exclusive_group()
group.add_argument('--plaintext',
group.add_argument('-p', '--plaintext',
help='Plaintext output (default)',
action='store_true')
group.add_argument('--uml', help='PlantUML format output',
group.add_argument('-u', '--uml',
help='PlantUML format output',
action='store_true')
group.add_argument('--json', help='OpenApiSchema JSON format output',
group.add_argument('-j', '--jsonschema',
help='OpenApiSchema JSON format output',
action='store_true')
group.add_argument('--rst',
group.add_argument('-r', '--rst',
help='reStructuredText output',
action='store_true')
parser.add_argument('-o', '--outfile',