]> git.ipfire.org Git - thirdparty/systemd.git/commit
ukify: check early if inputs exist and are readable 25791/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 20 Dec 2022 09:38:01 +0000 (10:38 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 20 Dec 2022 15:10:36 +0000 (16:10 +0100)
commit095ff238d064f7dfbf75c9cd13834ed892fe5fd9
treec6605e49da538c93d43c288f2bfa17b5a1abaaf0
parent33bdec184f08d955979484d63bb60fba3942adca
ukify: check early if inputs exist and are readable

It's much nicer for the user if we fail early instead of doing partial
processing if we cannot read some input. We can't do those checks immediately
from argparse.Parser.parse_args(), because we want to fully process the
commandline first. In particular, even with invalid args, if --help is
specified somewhere, we want to handle that. Thus, we need to delay the checks
after argparse.Parser.parse_args() returns.

Ukify didn't have type annotations on functions, but it probably should.
Jörg's suggested correction included them and we might just as well start here.
src/ukify/ukify.py