Skip to content

Commit

Permalink
Merge pull request #6 from Luftfartsverket/5-remove-unused-arguments
Browse files Browse the repository at this point in the history
feat: Fixes arguments and help message
  • Loading branch information
lfvbarcus authored Sep 7, 2023
2 parents 30f42c5 + 350f112 commit 4688f73
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions src/openapi_to_asciidoc/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,27 @@

import argparse
import json
import sys

from openapi_to_asciidoc.objects import OpenApi, OpenApiSchema


def get_arguments():
"""
Parses command line arguments
"""

usage = """
Usage:
Use stdin and stdout:
cat openapi.json | openapi_to_asciidoc.py -t openapi.j2
Use specific files for input and output:
openapi_to_asciidoc.py -j openapi.json -t openapi.j2 -o openapi.adoc
"""
parser = argparse.ArgumentParser(epilog=usage, formatter_class=argparse.RawDescriptionHelpFormatter)
parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter)

parser.add_argument(
"-j",
"--json",
help="OpenAPI JSON Specification File (default: stdin)",
help="OpenAPI JSON Specification File (default: openapi.json)",
type=argparse.FileType("r"),
default=sys.stdin,
default="openapi.json",
)
parser.add_argument(
"-o",
"--output",
nargs="?",
help="Where to output result (default: stdout)",
help="Where to output result (default: openapi.adoc)",
type=argparse.FileType("w"),
default=sys.stdout,
default="openapi.adoc",
)

return parser.parse_args()
Expand Down

0 comments on commit 4688f73

Please sign in to comment.