]> git.ipfire.org Git - thirdparty/mkosi.git/commit
mkosi: supress printing of argparse help on error 1243/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 27 Oct 2022 08:39:11 +0000 (10:39 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 27 Oct 2022 08:53:05 +0000 (10:53 +0200)
commit945319dfd29ebb35373f91b1e108d6d5d5a3b87e
tree36f30b35c436faf8903f325a8a38ef5bd5a7bf19
parentce4b6a52fe346e711a5a2cbe1424a0784ad4ff52
mkosi: supress printing of argparse help on error

We build a precise error message, but then bury it under a wall of text
produced by print_usage(). The printing of help (or some subset of it) on
parsing error is just useless. Most likely the user made a typo in an option,
and printing a few dozen lines (and more in the future) of unhelpful
semi-related information is counterproductive.

I'm surprised that argparse doesn't make this configurable, but looking at the
code, it seems that the behaviour is hardcoded. Docs and stackoverflow also
yield no hints.
mkosi/__init__.py