Commit 0937b76
committed
collect CLI arguments into a dataclass
Using library "clickdc", collect CLI arguments into a "cli_args"
dataclass.
A small amount of reordering was done, which affects the output of the
helpdoc, but the intention is for this to introduce no other functional
changes.
The properties in "cli_args" are sometimes mutated, for example when
reading comparable values from a DSN. But mutating the properties is
debatable.
New tests are introduced for the crucial user/host/port/socket
coordinates, but we stop short of adding new tests for every single
CLI argument.
Motivations
* clarity
* click_entrypoint() had too many positional arguments
* adding an CLI argument required adding both a decorator and a
matching positional argument to click_entrypoint()
* this work can be a step toward breaking up massive main.py and
test_main.py
Another related step would be gathering disparate runtime settings into
a self.settings property.1 parent e714436 commit 0937b76
5 files changed
Lines changed: 893 additions & 310 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
9 | 20 | | |
10 | 21 | | |
11 | 22 | | |
| |||
0 commit comments