From c718c77948de03d4decbe86dc1ffcc2e8ab9e1df Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Tue, 3 Oct 2023 23:42:47 +0200 Subject: [PATCH 1/4] Update cmd.py --- pysqa/cmd.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pysqa/cmd.py b/pysqa/cmd.py index 8c0bea3..02fd17a 100644 --- a/pysqa/cmd.py +++ b/pysqa/cmd.py @@ -7,7 +7,7 @@ from pysqa.utils.execute import execute_command -def command_line(argv, execute_command=execute_command): +def command_line(argv=None, execute_command=execute_command): """ Parse the command line arguments. @@ -25,6 +25,8 @@ def command_line(argv, execute_command=execute_command): run_time_max = None command = None job_id = None + if argv is None: + argv = sys.argv[1:] try: opts, args = getopt.getopt( argv, From 74c92fd912b46f72e05c5e1851b399a235b8fbc1 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Tue, 3 Oct 2023 23:45:28 +0200 Subject: [PATCH 2/4] Update cmd.py --- pysqa/cmd.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pysqa/cmd.py b/pysqa/cmd.py index 02fd17a..747bb8e 100644 --- a/pysqa/cmd.py +++ b/pysqa/cmd.py @@ -7,7 +7,7 @@ from pysqa.utils.execute import execute_command -def command_line(argv=None, execute_command=execute_command): +def command_line(arguments_lst=None, execute_command=execute_command): """ Parse the command line arguments. @@ -25,11 +25,11 @@ def command_line(argv=None, execute_command=execute_command): run_time_max = None command = None job_id = None - if argv is None: - argv = sys.argv[1:] + if arguments_lst is None: + arguments_lst = sys.argv[1:] try: opts, args = getopt.getopt( - argv, + arguments_lst, "f:pq:j:w:n:m:t:b:c:ri:dslh", [ "config_directory=", From 9e4a14606baffb846a2bd9ef6e17569d45b3f41c Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Tue, 3 Oct 2023 23:45:40 +0200 Subject: [PATCH 3/4] Update __main__.py --- pysqa/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pysqa/__main__.py b/pysqa/__main__.py index 46d86a4..1f0e4eb 100644 --- a/pysqa/__main__.py +++ b/pysqa/__main__.py @@ -3,4 +3,4 @@ from pysqa.cmd import command_line if __name__ == "__main__": - command_line(sys.argv[1:]) + command_line(arguments_lst=sys.argv[1:]) From 44d647e99408d46147a5077765cf45630285f44a Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Tue, 3 Oct 2023 23:50:29 +0200 Subject: [PATCH 4/4] Update test_cmd.py --- tests/test_cmd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_cmd.py b/tests/test_cmd.py index c1b7286..5bdaff2 100644 --- a/tests/test_cmd.py +++ b/tests/test_cmd.py @@ -14,7 +14,7 @@ def setUpClass(cls): @unittest.mock.patch('sys.stdout', new_callable=io.StringIO) def assert_stdout_command_line(self, cmd_args, execute_command, expected_output, mock_stdout): command_line( - argv=cmd_args, + arguments_lst=cmd_args, execute_command=execute_command ) self.assertEqual(mock_stdout.getvalue(), expected_output)