Skip to content

Commit

Permalink
Renamed arg parser to CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
gnikit committed Jun 22, 2022
1 parent 9be9ba2 commit 7494a4d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions fortls/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from multiprocessing import freeze_support

from .helper_functions import only_dirs, resolve_globs
from .interface import commandline_args
from .interface import cli
from .jsonrpc import JSONRPC2Connection, ReadWriter, path_from_uri
from .langserver import LangServer
from .parse_fortran import FortranFile
Expand All @@ -24,7 +24,7 @@ def error_exit(error_str: str):
def main():
#
freeze_support()
args = commandline_args(__name__).parse_args()
args = cli(__name__).parse_args()

if args.version:
print(__version__)
Expand Down
2 changes: 1 addition & 1 deletion fortls/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def __call__(self, parser, namespace, values, option_string=None):
setattr(namespace, self.dest, set(values))


def commandline_args(name: str = "fortls") -> argparse.ArgumentParser:
def cli(name: str = "fortls") -> argparse.ArgumentParser:
"""Parses the command line arguments to the Language Server
Returns
Expand Down
8 changes: 4 additions & 4 deletions test/test_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

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

from fortls.interface import commandline_args # noqa: E402
from fortls.interface import cli # noqa: E402

parser = commandline_args("fortls")
parser = cli("fortls")


def test_command_line_general_options():
Expand Down Expand Up @@ -87,7 +87,7 @@ def unittest_server_init():
from fortls.langserver import LangServer

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

server = LangServer(None, vars(args))
Expand Down Expand Up @@ -170,7 +170,7 @@ def test_version_update_pypi():
from fortls.jsonrpc import JSONRPC2Connection, ReadWriter
from fortls.langserver import LangServer

parser = commandline_args("fortls")
parser = cli("fortls")
args = parser.parse_args("-c f90_config.json".split())
args = vars(args)
args["disable_autoupdate"] = False
Expand Down

0 comments on commit 7494a4d

Please sign in to comment.