Commit df2ed72
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 c1ef3d8 commit df2ed72
4 files changed
+887
-309
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
1 | 9 | | |
2 | 10 | | |
3 | 11 | | |
| |||
0 commit comments