diff --git a/README.md b/README.md index e0190b8..8713670 100644 --- a/README.md +++ b/README.md @@ -217,7 +217,7 @@ python main.py 100 --exit-after-create The flag is recognised only in that second position. Given first, as in `python main.py --exit-after-create`, it is read as a grid size that cannot be parsed: `Invalid grid size argument, using default of 50.` is printed and the render loop is entered as usual. Apart from `--help` and `-h` (below), any other second argument, and every argument after the second, is ignored without a message. -Passing `--help` or `-h` in any position prints a usage line and exits with status `0`, before a window is opened, Viron is contacted, a file is written or usage reporting starts: +Passing `--help` or `-h` in any position prints the usage line, `Usage: python main.py [gridSize [--exit-after-create]]`, and exits with status `0`, before a window is opened, Viron is contacted, a file is written or usage reporting starts. The nested brackets show that `--exit-after-create` may only follow a grid size: ```bash python main.py --help diff --git a/main.py b/main.py index 01975e3..af7f33d 100644 --- a/main.py +++ b/main.py @@ -23,7 +23,7 @@ numGrids = 1 defaultGridSize = 50 -usage = "Usage: python main.py [gridSize] [--exit-after-create]" +usage = "Usage: python main.py [gridSize [--exit-after-create]]" def log(message): print(message) diff --git a/tests/test_main.py b/tests/test_main.py index 920bc4b..7537460 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -495,7 +495,7 @@ def test_asking_for_usage_prints_it_and_exits_without_side_effects(self): runpy.run_module("main", run_name="__main__") self.assertEqual(caught.exception.code, 0) - self.assertIn("Usage: python main.py [gridSize] [--exit-after-create]", output.getvalue()) + self.assertIn("Usage: python main.py [gridSize [--exit-after-create]]", output.getvalue()) mockStartUsageReporting.assert_not_called() mockRenderWindow.assert_not_called() self.assertEqual(os.listdir("."), [])