Skip to content

Commit 7494a4d

Browse files
committed
Renamed arg parser to CLI
1 parent 9be9ba2 commit 7494a4d

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

fortls/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from multiprocessing import freeze_support
88

99
from .helper_functions import only_dirs, resolve_globs
10-
from .interface import commandline_args
10+
from .interface import cli
1111
from .jsonrpc import JSONRPC2Connection, ReadWriter, path_from_uri
1212
from .langserver import LangServer
1313
from .parse_fortran import FortranFile
@@ -24,7 +24,7 @@ def error_exit(error_str: str):
2424
def main():
2525
#
2626
freeze_support()
27-
args = commandline_args(__name__).parse_args()
27+
args = cli(__name__).parse_args()
2828

2929
if args.version:
3030
print(__version__)

fortls/interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def __call__(self, parser, namespace, values, option_string=None):
1010
setattr(namespace, self.dest, set(values))
1111

1212

13-
def commandline_args(name: str = "fortls") -> argparse.ArgumentParser:
13+
def cli(name: str = "fortls") -> argparse.ArgumentParser:
1414
"""Parses the command line arguments to the Language Server
1515
1616
Returns

test/test_interface.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
66

7-
from fortls.interface import commandline_args # noqa: E402
7+
from fortls.interface import cli # noqa: E402
88

9-
parser = commandline_args("fortls")
9+
parser = cli("fortls")
1010

1111

1212
def test_command_line_general_options():
@@ -87,7 +87,7 @@ def unittest_server_init():
8787
from fortls.langserver import LangServer
8888

8989
root = (Path(__file__).parent / "test_source").resolve()
90-
parser = commandline_args("fortls")
90+
parser = cli("fortls")
9191
args = parser.parse_args("-c f90_config.json".split())
9292

9393
server = LangServer(None, vars(args))
@@ -170,7 +170,7 @@ def test_version_update_pypi():
170170
from fortls.jsonrpc import JSONRPC2Connection, ReadWriter
171171
from fortls.langserver import LangServer
172172

173-
parser = commandline_args("fortls")
173+
parser = cli("fortls")
174174
args = parser.parse_args("-c f90_config.json".split())
175175
args = vars(args)
176176
args["disable_autoupdate"] = False

0 commit comments

Comments
 (0)