Skip to content

Commit 6bc7720

Browse files
committed
feat(*): Use argument instead of option to allow multiple files
1 parent 32121aa commit 6bc7720

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

src/serialize_data.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,22 @@ def get_json_from_endpoints(lines):
9999

100100

101101
@click.command()
102-
@click.option(
103-
"--file-path",
104-
"-f",
105-
multiple=True,
106-
default=["proposed_endpoints.md"],
107-
help="Path for the proposed endpoints docs",
102+
@click.argument(
103+
"file_paths",
104+
nargs=-1,
105+
type=click.Path(exists=True),
106+
required=True,
108107
)
109-
def generate_json_from_docs_file(file_path):
108+
def generate_json_from_docs_file(file_paths):
109+
"""
110+
FILE_PATHS: Path(s) to the proposed endpoints docs. This can have multiple file values like
111+
112+
serialize_data.py proposed_endpoint.md api_endpoint.md
113+
114+
serialize_data.py *.md
115+
"""
110116
lines = ''
111-
for path in file_path:
117+
for path in file_paths:
112118
with open(path, "r") as endpoint_file:
113119
lines += endpoint_file.read()
114120
json_data = get_json_from_endpoints(lines)

0 commit comments

Comments
 (0)