Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions man/parser_standard_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import sys

from typing import IO, TYPE_CHECKING
from urllib.request import urlopen
from collections import defaultdict

if TYPE_CHECKING:
Expand Down Expand Up @@ -311,11 +310,6 @@ def _repr_html_(self):


if __name__ == "__main__":
URL = (
"https://raw.githubusercontent.com/OSGeo/grass/main/"
"lib/gis/parser_standard_options.c"
)

parser = argparse.ArgumentParser(
description="Extract GRASS default options from link."
)
Expand All @@ -327,19 +321,12 @@ def _repr_html_(self):
choices=["html", "csv", "grass", "markdown"],
help="Define the output format",
)
parser.add_argument(
"-l",
"--link",
default=URL,
dest="url",
type=str,
help="Provide the url with the file to parse",
)
parser.add_argument(
"-t",
"--text",
dest="text",
help="Provide the file to parse",
required=True,
)
parser.add_argument(
"-o",
Expand Down Expand Up @@ -371,7 +358,7 @@ def _repr_html_(self):
if args.output is not None
else contextlib.nullcontext(sys.stdout)
) as outfile,
open(args.text) if args.text is not None else urlopen(args.url) as cfile,
open(args.text) as cfile,
):
options = OptTable(parse_options(cfile.readlines(), startswith=args.startswith))
outform = args.format
Expand Down
Loading