Open gvanrossum opened 6 years ago
For not requiring --
perhaps we could conditionally include the daemon argparse flags in process_options
then call process_options
on the client side?
(Happy to work on a PoC if you want).
I assume there's an option to argparse to make it stop parsing at a specific point? I'm too lazy to look it up.
Ah, I think argparse.REMAINDER
is exactly what we need.
I wonder if there's a reasonable way to additionally make the run
argument optional. This would make simple dmypy command lines equivalent to mypy command lines, expect for replacing mypy
with dmypy
(once the above ideas and following imports have been implemented).
One way to do this would be to insert an implicit run
argument if there is no recognized command. These three command lines would then work in similar ways:
$ mypy main.py
$ dmypy main.py
$ dmypy run main.py
Alternatively, could we make it so that mypy --daemon <args>
invokes the daemon?
(I worry a bit about the default run
command in that it means you have to resort to tricks if the file you intend to type-check corresponds to any of the dmypy
subcommands.)
--
when specifying flags for [re]start